标签:while循环
age = 26
count = 0
while count < 4:
intput = int(input("请猜猜我的年龄:"))
if intput < age:
print ("输入过小,请重新输入")
elif intput > age:
print ("输入过大,请重新输入")
elif intput == age:
print ("答案正确,游戏退出")
break
count = count + 1
print count
else:
print ("输入错误超过3次,游戏退出")本文出自 “半夏轻浅的博客” 博客,请务必保留此出处http://sublime.blog.51cto.com/8856101/1829641
标签:while循环
原文地址:http://sublime.blog.51cto.com/8856101/1829641