我想要的是可以一直问问题,而且回答年龄小于1就会break,在年龄在6跟12之间再问有没有父母
在线等...
我目前写的如下:
age=int(input("请输人你的年纪:"))
while True:
if age >=6 and age <=12: with_parent = input("和父母一起来吗?(Y/N)") if (age >= 6 and age <= 12) and (with_parent == 'Y' or with_parent == 'y'): print("可以看保护级电影") age = int(input("请输人你的年纪:")) if age>=18: print("可以看限制级电影") elif age >12: print("可以看辅导级电影") else: print("只能看普通级电影")