Commit 74acd382 by BellCodeEditor

save project

parent c90bde51
Showing with 8 additions and 5 deletions
......@@ -13,6 +13,7 @@ pen.end_fill() #结束填充红色
turtle.done()
'''
player = input("出拳(石头/剪刀/布):")
print("玩家出拳" + player)
......@@ -21,10 +22,12 @@ list = ["石头","剪刀","布"]
computer = random.choice(list)
print(computer)
if (computer == "石头" and player == "布") or (computer == "布" and player == "剪刀") or (computer == "剪刀" and player == "石头"):
if player in list:
if (computer == "石头" and player == "布") or (computer == "布" and player == "剪刀") or (computer == "剪刀" and player == "石头"):
print("你赢了")
elif player == computer:
elif player == computer:
print("平局")
else:
else:
print("失败")
\ No newline at end of file
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