Python学习day01

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
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

 

转载于:https://www.cnblogs.com/zwnsyw/p/10258299.html

你可能感兴趣的:(Python学习day01)