#从控制台输入石头(1)/剪子(2)/布(3)
player=int(input("玩家出拳 石头(1)/剪子(2)/布(3)"))
#电脑随机出拳 computer
computer == 1
print("玩家出的拳是%d - 电脑出的拳是%d" %(player , computer))
#玩家选择出拳%d player
if (player == 1 and computer == 2)or(player == 2 and computer == 3)or( player == 3 and computer == 1):
print("电脑弱爆了")
#比较胜负
elif player =computer:
print("心有灵犀,再来一局")
#平局
#电脑胜出
else:
print("电脑胜出")
原文地址:https://www.cnblogs.com/dzqh/p/10019384.html
时间: 2024-11-04 04:02:01