1. 首页
  2. 编程语言
  3. Python
  4. 猜拳游戏(石头剪刀布.py)

猜拳游戏(石头剪刀布.py)

上传者: 2021-04-30 01:30:37上传 .PY文件 328.00 Bytes 热度 14次

# 石头 0 剪刀 1 布 2 import randombot = random.randint(0, 2)player = int(input("输入您的结果")) if (player == 1) and (bot == 2) or (player == 2) and (bot == 0) or (player == 0) and (bot == 1): print("玩家获胜") elif player == bot: print("你们打成平手") else: print("电脑获胜")

用户评论