age=32
count=0
while True:
if count==3:
print("你试的次数太多了,请退出")
break
age1=int(input("请输入数字:"))
if age==age1:
print("正确")
break
elif age>age1:
print("小于")
else:
print("大于")
count+=1本文出自 “Python学习历程” 博客,请务必保留此出处http://769082.blog.51cto.com/759082/1980898
原文:http://769082.blog.51cto.com/759082/1980898