import random
c = random.randint(1, 3)
x = int(input("请出拳 石头(1)/剪刀(2)/布(3): "))
print("玩家选择的拳头是 %d - 电脑出的拳是 %d " % (x, c))
if ((x == 1 and c == 2)
or (x == 2 and c == 3)
or (x == 3 and c == 1)):
print("电脑弱爆了!")
elif c == x:
print("平局!")
else:
print("不服气!决战到天亮!")
【Python】猜拳游戏
最新推荐文章于 2024-09-09 23:28:21 发布