您的位置:首页 > 编程语言 > Python开发

python3 猜数字游戏

2016-10-02 11:38 281 查看
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")


微信赞赏



内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  python 循环 猜数字