Commit 01aa74e0 by BellCodeEditor

save project

parent 242751c5
Showing with 8 additions and 11 deletions
......@@ -5,13 +5,10 @@ print("玩家出拳:"+x)
list=["石头","剪刀","布"]
j=random.choice(list)
print("计算机出拳:"+j)
if x==j:
print("平局")
elif x=="石头" and j=="剪刀":
print("玩家胜利")
elif x=="剪刀" and j=="布":
print("玩家胜利")
elif x=="布" and j=="石头":
print("玩家胜利")
else:
print("玩家失败")
\ No newline at end of file
if x in list:
if x==j:
print("平局")
elif (x=="石头" and j=="剪刀") or (x=="布" and j=="石头") or (x=="剪刀" and j=="布"):
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