Commit 7b616beb by BellCodeEditor

save project

parent aa0841a3
Showing with 12 additions and 6 deletions
...@@ -4,14 +4,13 @@ print("玩家出拳:"+player) ...@@ -4,14 +4,13 @@ print("玩家出拳:"+player)
app = ["石头","剪刀","布"] app = ["石头","剪刀","布"]
computer = random.choice(app) computer = random.choice(app)
print("电脑出拳:" + computer) print("电脑出拳:" + computer)
if APP in player: if player in app:
if app == player: if app == player:
print("平局") print("平局")
elif (computer == "石头" and player == "布")or(computer == "布" and player == "剪刀")or(computer== "剪刀" and player == "石头"):
elif (app = "石头" or player = "布"),(app = "布" or player = "剪刀"),(app = "剪刀" or player = "石头"):
print("电脑胜利") print("电脑胜利")
else: else:
print("玩家胜利") print("玩家胜利")
else: else:
print("输入错误") print("输入错误")
import random
player = input("请出拳(石头/剪刀/布):")
print("玩家出拳:"+player)
app = ["石头","剪刀","布"]
computer = random.choice(app)
print("电脑出拳:"+computer)
\ 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