Skip to main content

"if"

An example of the "if" function

age = input("What is your age?")

if age > str(30):
    print("Your getting up there...")
elif age >= str(20):
    print("Your still Young.")
elif age >= str(10):
    print("You lil thang you...")
else:
    print("Baby")

#empty question    
input("Do you like to drink?")

if age >= str(21):
    print("Go for it. Have fun!")
else:
    print("Nope. You are waaaay too young! Go home")