// An highlighted block
#!/usr/bin/env python3# -*- encoding: utf-8 -*-# 提示
prompt ="How old are you? "
prompt +="\n(Enter 'quit' when you are finished.) "# 运行状态
active =True# 标志while active:
age =input(prompt)if age =='quit':print("\nYou have logged out of the system.Thank you.")break# 退出运行else:
age =int(age)if age <0:print("\n\t▲▲▲ Good luck to you during pregnancy! ▲▲▲\n")# 母胎孕育中,祝你好运!elif age <=3:print(f"\n\t▲▲▲ You have {age} old,the ticket for free. ▲▲▲\n")elif age <=12:print(f"\n\t▲▲▲ You have {age} old,the ticket is 10$. ▲▲▲\n")elif age <=60:print(f"\n\t▲▲▲ You have {age} old,the ticket is 15$. ▲▲▲\n")elif age <100:print(f"\n\t▲▲▲ You have {age} old,the ticket for free. ▲▲▲\n")else:print("You're so funny. Bye!")
active =False# 结束循环