Commit 85f6ce12 by BellCodeEditor

save project

parent ce023be3
Showing with 13 additions and 10 deletions
import random #导入random
import random
A=input("玩家出拳(石头/剪子/布)")
print("玩家出拳:"+A)
C=["石头","剪刀","布"]
letter=random.choice(C)
print("计算机出拳:"+letter)
if A==letter:
print("平局")
elif A=="布" and letter=="石头":
print("恭喜,你赢了")
elif A=="剪刀" and letter=="布":
print("恭喜,你赢了")
elif A=="石头" and letter=="剪刀":
print("恭喜,你赢了")
if A in C:
if A==letter:
print("平局")
elif A=="布" and letter=="石头":
print("恭喜,你赢了")
elif A=="剪刀" and letter=="布":
print("恭喜,你赢了")
elif A=="石头" and letter=="剪刀":
print("恭喜,你赢了")
else:
print("很遗憾,你输了")
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