Commit 1bca2d21 by BellCodeEditor

save project

parent f01ef1c8
Showing with 10 additions and 10 deletions
p=input("请输入你要出的拳(石头,剪刀,布):")
print("玩家出的拳是:"+p)
"""
电脑出拳
"""
import random
p=input("请输入你要出的拳(石头,剪刀,布):")
list=["石头","剪刀","布"]
q=random.choice(list)
print("电脑出的拳是:"+q)
if p==q:
if p in list:
print("玩家出的拳是:"+p)
q=random.choice(list)
print("电脑出的拳是:"+q)
if p==q:
print("平局")
elif (p=="石头" and q=="剪刀" )or (p=="布" and q=="石头") or (p=="剪刀" and q=="布") :
elif (p=="石头" and q=="剪刀" )or (p=="布" and q=="石头") or (p=="剪刀" and q=="布") :
print("玩家胜出")
else:
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