Commit b87bc9cb by BellCodeEditor

save project

parent a0db0ec6
Showing with 9 additions and 6 deletions
import random
f=input("给爷出") f=input("给爷出")
print("玩家出拳:"+f) print("玩家出拳:"+f)
import random import random
list=["石头","剪刀","布"] list=["石头","剪刀","布"]
cpt=random.choice(list) cpt=random.choice(list)
print(cpt) print(cpt)
if f==cpt: if f in list:
print("平局") if f==cpt:
elif (f=="石头" and cpt=="剪刀") or (f=="布" and cpt=="石头" or f=="剪刀" and cpt=="布"): print("平局")
print("你赢了") elif (f=="石头" and cpt=="剪刀") or (f=="布" and cpt=="石头" or f=="剪刀" and cpt=="布"):
print("你赢了")
else:
print("你输了")
else: else:
print("你输了") 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