一个小游戏--猜年龄【continue and break and 计数器】very funning!
#猜年龄游戏,你醉了吗
age=24
counter=0
for i in range(10):
print("dddd:",counter)
if counter < 3:
age_num=int(input("input your age:"))
if age_num==age:
print("you are right")
break
elif age_num>age:
print("think smaller")
else:
print("think big..")
else:
confirm=input("please confirm your think:")
if confirm=='y':
counter = 0
continue
else:
print("too many")
break
counter=counter+1
努力只是为了给未来的自己多一个选择,而不是被动的接受!