Commit dd8e1a05 by BellCodeEditor

save project

parent a557b4e6
Showing with 17 additions and 7 deletions
r=input("请出拳(剪刀/石头/布):") while True:
print("玩家出拳:"+r) p=input("请出拳(剪刀/石头/布):")
import random as r import random as r
list=["剪刀","石头","布"] list=["石头","剪刀","布"]
l=r.choice(list) li=r.choice(list)
print("计算机出拳:"+l) if p in list:
\ No newline at end of file print("玩家出拳:"+p)
print("计算机出拳:"+li)
if p==li:
print("平局")
elif (p=="石头" and li=="剪刀") or (p=="剪刀" and li=="布") or (p=="布" and li=="石头"):
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