Commit 9d8a0f5a by BellCodeEditor

auto save

parent c2f1308f
Showing with 21 additions and 2 deletions
# 利用write()帮助悟空给诺依回信吧~ # 导入模块
\ No newline at end of file import random
# 输入玩家信息
player = input("请输入(石头/剪刀/布):")
# 输出玩家信息
print("玩家出拳:"+player)
#输出计算机随机数
list1 = ["石头","剪刀","布"]
computer = random.choice(list1)
print("计算机出拳:",computer)
if player in list1:
#逻辑判断,石头剪刀布的输赢
if player == computer:
print("平局了!")
elif player == "石头" and computer == "剪刀" or player == "剪刀" and computer =="布" or player == "布" and computer == "石头":
print("我赢了,好开心!")
else:
print("我输了,不开心!")
else:
print("请不要乱输入,否则我就打110!")
\ 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