Commit 4107d1d1 by BellCodeEditor

save project

parent 3151558f
Showing with 9 additions and 8 deletions
# 玩家出拳 # 玩家出拳
import random import random
player=input() p=input()
print("玩家出拳:",player) print("玩家出拳:",p)
list1=["石头","剪刀","布"] list1=["石头","剪刀","布"]
computer=random.choice(list1) c=random.choice(list1)
print("电脑出拳:",computer) print("电脑出拳:",c)
if player==computer: if p==c:
print("平局") print("平局")
elif player=="石头" and computer=="剪刀": elif p=="石头" and c=="剪刀":
print("you win!") print("you win!")
elif player=="剪刀" and computer=="布": elif p=="剪刀" and c=="布":
print("you win!") print("you win!")
elif player=="布" and computer=="石头": elif p=="布" and c=="石头":
print("you win!") print("you win!")
else: else:
print("you lose!") print("you lose!")
\ 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