Commit 4d0ce976 by BellCodeEditor

save project

parent 133b3f24
Showing with 9 additions and 2 deletions
...@@ -5,4 +5,11 @@ print("玩家出拳:"+player) ...@@ -5,4 +5,11 @@ print("玩家出拳:"+player)
o=["石头","剪刀","布"] o=["石头","剪刀","布"]
cup=random.choice(o) # 计算机出拳 cup=random.choice(o) # 计算机出拳
print("计算机出拳:"+cup) print("计算机出拳:"+cup)
\ No newline at end of file
if player==cup:
print("平局")
elif (player=="布" and cup=="石头") or (player=="石头" and cup=="剪刀") or (player=="剪刀" and cup=="布"):
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