Commit 2e9cb032 by BellCodeEditor

save project

parent 5117dfc8
Showing with 31 additions and 0 deletions
import random import random
# 玩家出拳 # 玩家出拳
a = input("你出啥?石/剪/布:") a = input("你出啥?石/剪/布:")
while not (a in ["石","剪","布"]):
a = input("你出啥?石/剪/布:")
print("玩家出的是----" +a ) print("玩家出的是----" +a )
#电脑出拳 #电脑出拳
d = random.choice(["石","剪","布"]) d = random.choice(["石","剪","布"])
print("电脑出的是----" +d ) print("电脑出的是----" +d )
if a =="布":
if d =="布":
print("平局!")
elif d == "剪":
print("输了!")
elif d =="石":
print("赢了!")
if a =="剪":
if d =="布":
print("赢了!")
elif d == "剪":
print("平局!")
elif d =="石":
print("输了!")
if a =="石":
if d =="布":
print("输了!")
elif d == "剪":
print("赢了!")
elif d =="石":
print("平局!")
input()
\ 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