Commit dd524958 by BellCodeEditor

save project

parent cf0ea5bc
Showing with 20 additions and 11 deletions
import random import random
a=input("石头,剪刀,布:")# 玩家出拳
print("出"+a)
b=["石头","剪刀","布"] b=["石头","剪刀","布"]
c=random.choice(b) while True:
print("出"+c) a=input("石头,剪刀,布:")# 玩家出拳
print("出"+a)
if a==c: if a in b:
print("平局") c=random.choice(b)
elif (a=="石头" and c=="剪刀") or (a=="剪刀" and c=="布") or (a=="布" and c=="石头"): print("出"+c)
print("恭喜,你胜利了") #z=["剪刀","石头","布"]
else:
print("很遗憾,你失败了") if a==c:
print("平")
break
elif (a=="剪刀" and c=="布") or (a=="布" and c=="石头") or (a=="石头" and c=="剪刀"):
print("赢")
break
else:
print("输")
break
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