Commit 2dd690f5 by BellCodeEditor

save project

parent 220fe62b
Showing with 17 additions and 0 deletions
# 玩家出拳
import random
list=["石头","剪刀","布"]
print("三局两胜制")
for i in range(3):
#玩家出拳
player=input("玩家请出拳!")
print("我:我出"+player)
#机器人出拳
robot=random.choice(list)
print("机器人:我出"+robot)
if player==robot:
print("结果:平局。")
elif (player=="剪刀" and robot=="石头")or(player=="布" and robot=="剪刀")or(player=="石头" and robot=="布"):
print("结果:很遗憾,你输了!")
else:
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