dimanche 22 septembre 2019

New to if conditional "Python" [on hold]

First of all sorry if my English is not that good, but I'm trying my best to learn. I'm new to python and I was learning about the If conditional so I tried to make a little script about Cinema ticket payment but it seems to get me syntax error when running the script on the Windows Shell, Here is what I wrote on Sublime hopefully someone corrects my mistake with explanations if possible!

age = 21

#5 to 10 = 7$

#11 to 65 = 10$

#66+ = 5$

if age >= 5 and age <= 10: 
    print("YOU PAY 7 DOLLARS!")
elif age >= 11 and <= 65:
    print("YOU PAY 10 DOLLARS!")
elif age >= 66:
    print("YOU PAY 5 DOLLARS!")
else:
    print("YOU PAY NOTHING!")

Aucun commentaire:

Enregistrer un commentaire