3 数字猜谜游戏
作者:互联网
# 数字猜谜游戏 number = 7 guess = -1 print("数字猜谜游戏!") while guess != number: guess = int(input("请输入你猜的数字:")) if guess == number: print("你猜对了!") print("游戏结束") elif guess < number: print("猜的数字小了") elif guess > number: print("猜的数字大了")
结果:
标签:guess,游戏,猜谜,number,print,数字 来源: https://www.cnblogs.com/CPU-Easy/p/12116169.html