Python Forum

Full Version: Invalid Syntax
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am currently learning how to code on my own before I start classes on coding and for some reason when I want to label certain things I get an invalid syntax. I do have very basic background on python but I have no idea what is wrong. Any help would be appreciated, I know this will be simple for most people.
#Ask the user for a number. Depending on whether the number is even or odd, print out an appropriate message to the user.
number = int(input('Enter any whole number: ')
twelve = number % 2
if twelve == 0:
    print('Your number is even')
    elif:
        print('Your number is odd')
You are missing a ) on line 2.
Line 2: missing parenthesis
Line 6: "elif" should not be indented
Thanks for the help guys.