Commit f2e6d1d1 by BellCodeEditor

auto save

parent fa8a201a
Showing with 13 additions and 8 deletions
import random
a=input("请输入你要出的:")
print("玩家:"+a)
list=["石头","布","剪刀"]
b = random.choice(list)
print("人机:"+b)
if a==b:
while True:
a=input("请输入你要出的(剪刀/石头/布):")
if a=="石头" or a=="剪刀" or a=="布":
print("玩家:"+a)
list=["石头","布","剪刀"]
b = random.choice(list)
print("人机:"+b)
if a==b:
print("平局")
elif (a=="剪刀" and b=="布") or (a=="石头" and b=="剪刀") or (a=="布" and b=="石头"):
elif (a=="剪刀" and b=="布") or (a=="石头" and b=="剪刀") or (a=="布" and b=="石头"):
print("玩家胜利")
else:
else:
print("人机胜利")
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