xingtai -猜数字

# 猜数字游戏
# 电脑出一个1-100的数字,你猜一下看能不能猜中


# 1.电脑是不是得随机出一个和数字
import random
comptuer = random.randint(1,100) # 数字

for i in range(20):
    # 2.我们进行猜数字  in  put
    we = input("请输入作战编号")  # 字符串
    we = int(we)
    # 3。判断
    if comptuer == we:
        print("您的战场是武汉")
    elif we>comptuer:
        print("你猜的大了")
    elif we<comptuer:
        print("你猜的小了")










发布了390 篇原创文章 · 获赞 19 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/houlaos/article/details/104416704
今日推荐