python3 猜數字遊戲

x=10    #the number you set to gess
i=1
n=6
while(i<=6):
    print("@_@:")
    print(n)
    print(" times left")
    y = input("please input the number you guess:")
    y = int(y)
    if(y == x):
        print("@_@:")
        print("you win")
        break
    elif(y > x):
        print("@_@:")
        print("the number you guess is a little bigger")
    elif(y < x):
        print("@_@:")
        print("the number you guess is a little less")
    i = i + 1
    n = n - 1
else:
    print("@_@:")
    print("times use up,you lose")



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章