Commit fe221872 by BellCodeEditor

save project

parent c8e14a14
Showing with 13 additions and 3 deletions
...@@ -2,5 +2,15 @@ player=input("请出拳(石头/剪刀/布)") ...@@ -2,5 +2,15 @@ player=input("请出拳(石头/剪刀/布)")
print(player) print(player)
import random import random
list=["石头","剪刀","布"] list=["石头","剪刀","布"]
sb=random.choice(list) cm=random.choice(list)
print(sb) print(cm)
\ No newline at end of file if player==cm:
print("平局")
elif(player=="石头" and cm=="剪刀"):
print("胜利")
elif(player=="石头" and cm=="布"):
print("失败")
elif(player=="剪刀" and cm=="石头"):
print("失败")
elif(player=="布" and cm=="石头"):
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