Commit b3586bdf by BellCodeEditor

auto save

parent 0a3375c4
Showing with 0 additions and 21 deletions
#导入
import random
#玩家输入
player = input("玩家出拳:")
#计算机出拳
list = ["石头","剪刀","布"]
computer = random.choice(list)
print(computer)
if player in list:
#显示结果
if player==computer:
print("平局")
elif (player == "石头" and computer=="剪刀") or (player == "剪刀" and computer=="布") or (player == "布" and computer=="石头"):
print("玩家赢")
else:
print("计算机赢")
else:
print("输错了")
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