Commit ef0d172f by BellCodeEditor

save project

parent b5c6bbbe
Showing with 17 additions and 0 deletions
import random
for i in range(5):
pl=input("请出拳:")
list=["剪刀","石头","布"]
if pl in list:
print("玩家出拳:"+pl)
cp=random.choice(list)
print("计算机出拳:"+cp)
if pl==cp:
print("平局")
elif (pl=="剪刀" and cp=="布") or (pl=="石头" and cp=="剪刀") or (pl=="布" and cp=="石头"):
print("玩家赢了")
else:
print("很遗憾,您输了")
else:
print("输入错误!")
\ No newline at end of file
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