i = 1
while True:
while i <= 3:
age = int(input("input yout guess age:"))
if age == 22:
print("yes!")
elif age < 22:
print("no,your guess little!")
elif age > 22:
print("no,your guess old!")
else:
print("press error!")
i += 1
print("you are pig!")
j = input("continue to guess? >: yes / no")
if j == "yes":
i = 1
print(end = "")
elif j == "no":
break
else:
print("press error!")
python while循环简单例子
于 2022-02-06 19:26:19 首次发布