Commit 537e59e0 by BellCodeEditor

save project

parent a31eeada
Showing with 7 additions and 3 deletions
...@@ -5,9 +5,12 @@ import random ...@@ -5,9 +5,12 @@ import random
hand=["石头","剪刀","布"] hand=["石头","剪刀","布"]
litter=random.choice(hand) litter=random.choice(hand)
print(litter) print(litter)
if play==litter: if play in hand:
if play==litter:
print("平") print("平")
elif play=="石头" and litter=="剪刀" or play=="剪刀" and litter=="布" or play=="布" and litter=="石头": elif play=="石头" and litter=="剪刀" or play=="剪刀" and litter=="布" or play=="布" and litter=="石头":
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