Commit deb0faba by BellCodeEditor

auto save

parent c51c09c6
Showing with 14 additions and 11 deletions
a=input("玩家出拳")# 玩家出拳
print(a)
import random import random
list=["y","o","m"] a=input("请输入(石头/剪刀/布)")
b=random.choice(list) print("玩家出拳:"+a)
print(b) list=["石头","剪刀","布"]
if a==b: if a in list:
print("=") computer=random.choice(list)
elif a=="y"and b=="m"or a=="o"and b=="y"or a=="m"and b=="o": print("计算机出拳:"+computer)
print(">") if a==computer:
print("平局")
elif a=="剪刀" and computer=="布" or a=="布" and computer=="石头" or a=="石头" and computer=="剪刀":
print("玩家赢了")
else:
print("玩家输了")
else: else:
print("<") print("输入错误")
\ No newline at end of file \ 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