Commit 64e836b5 by BellCodeEditor

save project

parent c06f3b30
Showing with 16 additions and 9 deletions
...@@ -5,15 +5,22 @@ print("玩家"+player) ...@@ -5,15 +5,22 @@ print("玩家"+player)
list=["石头","剪刀","布"] list=["石头","剪刀","布"]
letter=random.choice(list) letter=random.choice(list)
print("computer"+letter) print("computer"+letter)
if player == letter: if player in list :
print("平")
if player == letter:
print("平")
elif player=="布" and letter=="石头":
print("玩家胜") elif player=="布" and letter=="石头":
elif player=="剪刀" and letter=="布": print("玩家胜")
print("玩家胜") elif player=="剪刀" and letter=="布":
elif player == "石头" and letter == "剪刀": print("玩家胜")
print("玩家胜") elif player == "石头" and letter == "剪刀":
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