Commit 945e837f by BellCodeEditor

save project

parent a86aa702
Showing with 13 additions and 3 deletions
...@@ -3,5 +3,15 @@ import random ...@@ -3,5 +3,15 @@ import random
x=input("出什么拳?(石头/剪刀/布)") x=input("出什么拳?(石头/剪刀/布)")
print("玩家出拳:"+x) print("玩家出拳:"+x)
list=["石头","剪刀","布"] list=["石头","剪刀","布"]
j=(random.choice(list)) j=random.choice(list)
print("计算机出拳:"+j) print("计算机出拳:"+j)
\ No newline at end of file if x==j:
print("平局")
elif x=="石头" and j=="剪刀":
print("玩家胜利")
elif x=="剪刀" and j=="布":
print("玩家胜利")
elif x=="布" and j=="石头":
print("玩家胜利")
else:
print("玩家失败")
\ 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