Why doesnt this work in python 3

0 Ash Marz · June 19, 2015
weight = eval(input("Put in your mass: "))
Put in your mass: 65
>>> standard = 50
>>> if weight < standard:
print ("Have a safe ride")
print ("NAHHHHH!")
SyntaxError: invalid syntax
>>> if weight < standard:
print ("Have a safe ride")
    print ("NAHHHHH!")
    
SyntaxError: unindent does not match any outer indentation level

Post a Reply

Replies

Oldest  Newest  Rating
+1 alex constantin · June 20, 2015
You need to indent the if blocks
0 Ash Marz · June 20, 2015
it is already indented right?
+1 alex constantin · June 20, 2015
Are you typing on a console or script?
0 Mr. Computer · June 20, 2015
Write This In code mode because indentation is really important in python then we can help you

like this

Your Code HEre 
0 Jagdeep Matharu · June 26, 2015
Its just the indent issue , here is the right code:

>>> weight = eval(input("Put in your mass: "))

Put in your mass: 65
>>> standard = 50

>>> if weight < standard:
    print ("Have a safe ride")
    print ("NAHHHHH!")
elif weight > standard:
    print ("Have a safe ride")
    print ("YAHHHHH!")

    
Have a safe ride
YAHHHHH!

Enjoy ^^
  • 1

Python

106,940 followers
About

This section is all about snakes! Just kidding.

Links
Moderators
Bucky Roberts Administrator