python if-elif-else 判断

#!/usr/bin/python
#coding=utf-8
#好好学习,天天向上
age=12
if age<4:
    price=0
elif age<18:
    price=40
elif age>66:
    price=40
else:
    price=20
print(f"your admmssion cost is ${price}.")

  

 

 判断多条件时可用if-elif-else结构语句

posted @ 2021-01-03 21:09  tigergaonotes  阅读(93)  评论(0编辑  收藏  举报