Commit fa47d61a by BellCodeEditor

save project

parent 605e80b5
Showing with 10 additions and 5 deletions
...@@ -5,16 +5,20 @@ import random ...@@ -5,16 +5,20 @@ import random
list = ["石头","剪刀","布"] list = ["石头","剪刀","布"]
sb=random.choice(list) sb=random.choice(list)
print(sb) print(sb)
if player==sb if piayer in list
if player==sb
print("平局") print("平局")
elif player == "石头" and sb=="剪刀": elif player == "石头" and sb=="剪刀":
print("你赢了") print("你赢了")
elif player == "剪刀" and sb=="布": elif player == "剪刀" and sb=="布":
print("你赢了") print("你赢了")
elif player == "布" and sb=="石头": elif player == "布" and sb=="石头":
print("你赢了") print("你赢了")
else: else:
print("你死了") 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