编程语言的学习 ------ python小游戏猜数字(使用for循环)

使用for循环写小游戏~

#Author:wqh
number = 30
for i in range(3):
    guess_number = int(input("guess_number:"))
    if guess_number > 30:
        print("bigger")
    elif guess_number <30:
        print("smaller")
    else:
        print("you are right!")
        break
else:
    print("you have tired 3 times,game exit")

你可能感兴趣的:(python从零开始)