Invalid Syntax - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Invalid Syntax (/thread-16542.html) |
Invalid Syntax - HekticEz - Mar-04-2019 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') RE: Invalid Syntax - stranac - Mar-04-2019 You are missing a ) on line 2.
RE: Invalid Syntax - Olivier - Mar-04-2019 Line 2: missing parenthesis Line 6: "elif" should not be indented RE: Invalid Syntax - HekticEz - Mar-04-2019 Thanks for the help guys. |