Commit fc314b35 by BellCodeEditor

save project

parent a72dd4f3
Showing with 14 additions and 10 deletions
import random import random
list = ["剪刀","石头", "布"]
player = input("请出拳:") player = input("请出拳:")
print("玩家:" + player) print("玩家:" + player)
list = ["剪刀","石头", "布"]
compdhu = random.choice(list) compdhu = random.choice(list)
print("电脑:" + compdhu) print("电脑:" + compdhu)
if player == compdhu: if player in list:
print("平局") print("输入正确")
elif player == "石头" and compdhu == "剪刀" if player == compdhu:
print("你赢了") print("平局")
elif player == "剪刀" and compdhu == "布" elif player == "石头" and compdhu == "剪刀":
print("你赢了") print("你赢了")
elif player == "布" and compdhu == "石头" elif player == "剪刀" and compdhu == "布":
print("你赢了") print("你赢了")
elif player == "布" and compdhu == "石头":
print("你赢了")
else:
print("你输了")
else: else:
print("你输了") print("输入错误")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment