1. 程式人生 > >python——if判斷購買門票

python——if判斷購買門票

() true pri nbsp 支付 輸入 put pytho spa

 1 while True:
 2     age = input("你幾歲了:")
 3     if age.isdigit():
 4         age = int(age)
 5         if age<=4:
 6             print("你需要支付4$")
 7         elif age>4 and age<18:
 8             print("傻逼你需要支付5$")
 9         elif age>=18:
10             print("傻逼支付10$")
11 
12     else:
13 print("傻逼你輸入的是什麽東西")

python——if判斷購買門票