Home > Mobile >  Are you old enough to drink? Python problem
Are you old enough to drink? Python problem

Time:11-21

I’m trying to write a function that tells the user if they are old enough to drink.

Whenever I run what I wrote it says there is a syntax error in line 3 where it says “If age> 20: ”. What am I doing wrong:

age = int(input("how old are you?")

if age > 20:
    print("You're old enough to drink")
else:
    print("Go drink some apple juice")

CodePudding user response:

You forgot a bracket age = int(input("how old are you?"))

CodePudding user response:

age = int(input("how old are you?")< You are missing a ) at the end of the line.

  • Related