print("====================")
print("      猜数字游戏")
print("====================")
import random

random=random.randint(1,10)
name=input("请输入你的名字")
print("欢迎"+name+"来到猜数字游戏")
while 1:
    tem=int(input("请输入你猜的数字:"))
    if tem < random :
        print("你猜的数字小了,请再猜一次")
    elif tem>random :
        print("你猜的数字大了,请再猜一次")
    else:
        print("恭喜你回答正确!")
        break
print("游戏结束")

相关文章:

  • 2021-07-07
  • 2021-11-12
  • 2021-07-31
  • 2021-11-10
  • 2022-01-01
猜你喜欢
  • 2021-08-03
  • 2021-05-27
  • 2022-12-23
  • 2021-10-01
  • 2021-08-29
  • 2021-04-22
相关资源
相似解决方案