Commit d8babb42 by BellCodeEditor

save project

parent a08b1e63
Showing with 15 additions and 12 deletions
# 玩家出拳
plo=input("请问你出(石头/剪刀/布)?")
print("玩家出拳:"+plo)
import random
list=["石头","剪刀","布"] list=["石头","剪刀","布"]
r=random.choice(list) plo=input("请问你出(石头/剪刀/布)?")
print("电脑出拳:"+r) if plo in list:
if plo==r: print("玩家出拳:"+plo)
print("平局") import random
elif (plo=="剪刀" and r=="石头")or (plo=="石头" and r=="布")or(plo=="布" and r=="剪刀"):
print("你输了") r=random.choice(list)
print("电脑出拳:"+r)
if plo==r:
print("平局")
elif (plo=="剪刀" and r=="石头")or (plo=="石头" and r=="布")or(plo=="布" and r=="剪刀"):
print("你输了")
else:
print("你赢了")
else: else:
print("你赢了") print("输入错误")
\ No newline at end of file \ 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