Commit d570a83d by BellCodeEditor

save project

parent 55ac7b5f
Showing with 12 additions and 9 deletions
...@@ -4,16 +4,19 @@ import random ...@@ -4,16 +4,19 @@ import random
list=["石头","剪刀","布"] list=["石头","剪刀","布"]
c = random.choice(list) c = random.choice(list)
print("电脑出拳"+c) print("电脑出拳"+c)
if c==p: if p in list:
print("平局") if c==p:
elif c=="剪刀" and p=="石头": print("平局")
print("你赢了") elif c=="剪刀" and p=="石头":
print("你赢了")
elif c=="石头" and p=="布": elif c=="石头" and p=="布":
print("你赢了") print("你赢了")
elif c=="布" and p=="剪刀": elif c=="布" and p=="剪刀":
print("你赢了") print("你赢了")
else:
print("你输了")
else: 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