samedi 18 février 2017

else: syntax error Python

rawAge = input("Enter your age: ")

age = int(rawAge)

if age > 20:
    print("You are older than 20 years old")
    else:
    print("You are too young")

I'm getting:

C:\Python36\programs>py test.py
  File "test.py", line 8
    else:
       ^
SyntaxError: invalid syntax

Every where I look its telling me to do it like this, what am I missing?

Aucun commentaire:

Enregistrer un commentaire