Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Invalid Syntax
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')
        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.

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  'invalid syntax' error rix 3 83 Dec-12-2019, 11:14 PM
Last Post: stullis
  "SynatxError" Invalid Syntax Help Michael1 2 110 Nov-27-2019, 11:24 PM
Last Post: Michael1
  SyntaxError: invalid syntax Kanashi 9 258 Nov-24-2019, 08:47 PM
Last Post: Kanashi
  Invalid Syntax error mustfirst 9 405 Nov-11-2019, 10:07 AM
Last Post: deep_logic
  I am getting invalid syntax. sandeep25 0 156 Oct-13-2019, 02:02 PM
Last Post: sandeep25
  def Display Data Invalid Syntax error Linuxdesire 1 170 Oct-11-2019, 05:10 AM
Last Post: stranac
  Invalid syntax Davidelca96 1 253 Sep-17-2019, 12:44 PM
Last Post: stranac
  SyntaxError: invalid syntax jurg1505 5 575 Jul-14-2019, 03:30 PM
Last Post: ichabod801
  SyntaxError: invalid syntax Truman 7 6,085 Jun-16-2019, 04:54 PM
Last Post: apollo
  Why do i have invalid syntax on a line after print, i see no error ? iofhua 5 385 May-24-2019, 05:42 PM
Last Post: Yoriz

Forum Jump:

Users browsing this thread: 1 Guest(s)