Commit 17eb4bc6 by BellCodeEditor

save project

parent 4107d1d1
Showing with 9 additions and 5 deletions
...@@ -5,13 +5,16 @@ print("玩家出拳:",p) ...@@ -5,13 +5,16 @@ print("玩家出拳:",p)
list1=["石头","剪刀","布"] list1=["石头","剪刀","布"]
c=random.choice(list1) c=random.choice(list1)
print("电脑出拳:",c) print("电脑出拳:",c)
if p==c: if p in list1:
if p==c:
print("平局") print("平局")
elif p=="石头" and c=="剪刀": elif p=="石头" and c=="剪刀":
print("you win!") print("you win!")
elif p=="剪刀" and c=="布": elif p=="剪刀" and c=="布":
print("you win!") print("you win!")
elif p=="布" and c=="石头": elif p=="布" and c=="石头":
print("you win!") print("you win!")
else: else:
print("you lose!") print("you lose!")
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