Commit 71c02e96 by BellCodeEditor

save project

parent bde760e5
Showing with 11 additions and 2 deletions
...@@ -3,4 +3,13 @@ print("玩家出拳:"+player) ...@@ -3,4 +3,13 @@ print("玩家出拳:"+player)
import random import random
list=["石头","剪刀","布"] list=["石头","剪刀","布"]
laoliu=random.choice(list) laoliu=random.choice(list)
print("计算机出拳:"+laoliu) print("计算机出拳:"+laoliu)
\ No newline at end of file if player in list:
if player == laoliu:
print("平局")
elif (player=="石头" and laoliu=="剪刀") or (player=="剪刀" and laoliu=="布") or (player=="布" and laoliu=="石头"):
print("玩家赢")
else :
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