Commit bf0f19dc by BellCodeEditor

save project

parent c45f18a4
Showing with 16 additions and 15 deletions
i=["石头","剪刀","布"] i=["石头","剪刀","布"]
z=input("你要出啥?") while True:
import random z=input("你要出啥?")
print("玩家出拳:"+z) import random
x=random.choice(i) print("玩家出拳:"+z)
print("电脑出拳:"+x) x=random.choice(i)
if z==x: print("电脑出拳:"+x)
print("平局") if z==x:
elif z=="剪刀" and x=="布": print("平局")
print("玩家胜") elif z=="剪刀" and x=="布":
elif z=="石头" and x=="剪刀": print("玩家胜")
print("玩家胜") elif z=="石头" and x=="剪刀":
elif z=="布" and x=="石头": print("玩家胜")
print("玩家胜") elif z=="布" and x=="石头":
else: print("玩家胜")
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