invalid syntax inpython(ver 3.2.2)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Richard Bryant
    New Member
    • Feb 2012
    • 1

    invalid syntax inpython(ver 3.2.2)

    I`m new to python and I do`t understand why it repond:invalid syntax when I run this:

    x=12
    y=7
    z=8
    if x<y and y<z: print ('z is the largest')
    elif x<y and y>z: print ('y is the largest')
    else print (x is the largest')
  • Smygis
    New Member
    • Jun 2007
    • 126

    #2
    Your problem is a missing : after else and a missing ' in the last print.
    Code:
    else: print ('x is the largest')

    Comment

    Working...