Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Invalid Syntax
#1
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')
Quote
#2
You are missing a ) on line 2.
Quote
#3
Line 2: missing parenthesis
Line 6: "elif" should not be indented
Quote
#4
Thanks for the help guys.
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Invalid JSON payload received. Unknown name “”: Root element must be a message." hellraiser 4 148 Aug-18-2019, 03:41 PM
Last Post: hellraiser
  ValueError: invalid literal for int() with base 10: '' Jay123 7 225 Aug-05-2019, 02:43 PM
Last Post: Jay123
  SyntaxError: invalid character in identifier neogeo 2 123 Jul-27-2019, 11:11 AM
Last Post: neogeo
  SyntaxError: invalid character in identifier ricardodepaula 2 112 Jul-25-2019, 09:20 PM
Last Post: ricardodepaula
  SyntaxError: invalid syntax jurg1505 5 227 Jul-14-2019, 03:30 PM
Last Post: ichabod801
  Invalid archive error when attempting to install dash bootstrap components meaydemi 0 291 Jul-11-2019, 05:49 PM
Last Post: meaydemi
  SyntaxError: invalid syntax Truman 7 4,177 Jun-16-2019, 04:54 PM
Last Post: apollo
  ValueError: invalid rectstyle object fen1c5 1 354 Jun-05-2019, 02:51 PM
Last Post: heiner55
  Why do i have invalid syntax on a line after print, i see no error ? iofhua 5 258 May-24-2019, 05:42 PM
Last Post: Yoriz
  invalid syantx metro779966 3 348 Apr-26-2019, 03:00 PM
Last Post: keames

Forum Jump:


Users browsing this thread: 1 Guest(s)