import random
matrix = ["石头", "剪刀", "布"]
player = input("请输入你出的拳[石头,剪刀,布]:")
computer = int(random.randint(0, 2))
enemy = matrix[computer]
if player != matrix[0] and player != matrix[1] and player != matrix[2]:
print("你不按规矩来,拖出去斩了")
elif(player == "石头" and computer == "剪刀") or (player == "剪刀" and computer == "布") or (player == "布" and computer == "石头"):
print("玩家出的是%s,电脑出的是%s,你赢了" % (player, enemy))
elif player == computer:
print("玩家出的是%s,电脑出的是%s,平局" % (player, enemy))
else:
print("玩家出的是%s,电脑出的是%s,你输了" % (player, enemy))