代码语言:javascript复制
age = 23
count=0
while count<3:
guess_age = int (input("My age:"))
if age ==guess_age:
print("nice, you got it")
break
elif age < guess_age:
print("guess bigger!think smaller.")
else:
print("guess smaller,think bigger.")
count=count 1
if count==3:
keep=input("ndo you want to keeping guess?if no,input a n.")
if keep!="n":
count=0
print("bey bey!")
View Code
代码语言:javascript复制age = 23
count=0
while count<3:
guess_age = int (input("My age:"))
if age ==guess_age:
print("nice, you got it")
break
elif age < guess_age:
print("guess bigger!think smaller.")
else:
print("guess smaller,think bigger.")
count=count 1
if count==3:
keep=input("ndo you want to keeping guess?if no,input a n.")
if keep!="n":
count=0
print("bey bey!")
https://blog.csdn.net/PythonEnding/article/details/86325351
2019-01-12 00:08:08