Commit 2cb90e65 by BellCodeEditor

save project

parent 96506110
Showing with 8 additions and 6 deletions
...@@ -4,11 +4,13 @@ a=["石头","剪刀","布"] ...@@ -4,11 +4,13 @@ a=["石头","剪刀","布"]
import random import random
b=random.choice(a) b=random.choice(a)
print("电脑出拳:"+b) print("电脑出拳:"+b)
if p==b: if p in a:
print("平局") if p==b:
elif p=="石头" and b=="剪刀" or p=="剪刀" and b=="布" or p=="布" and b=="石头": print("平局")
print("你赢了") elif p=="石头" and b=="剪刀" or p=="剪刀" and b=="布" or p=="布" and b=="石头":
print("你赢了")
else:
print("Gey over")
else: else:
print("Gey over") print("SB,错了")
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