python——if判断购买门票

Posted xgzx

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python——if判断购买门票相关的知识,希望对你有一定的参考价值。

 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判断购买门票的主要内容,如果未能解决你的问题,请参考以下文章