Commit 290f6cb1 by BellCodeEditor

save project

parent 9a60a277
Showing with 10 additions and 13 deletions
# 玩家出 # 玩家出
s=input("请出剪刀,石头,布\n")#s=player s=input("请出剪刀,石头,布\n")#s=player
print("玩家出的是"+s)
import random import random
list=["剪刀","石头","布"] list=["剪刀","石头","布"]
a= random.choice(list)#a=computer a= random.choice(list)#a=computer
if s in list: print("电脑出的是:"+a)
print("玩家出的是"+s) if s==a:
print("电脑出的是:"+a) print("平局\n_________________")
if s==a: elif s=="布" and a=="石头"\
print("平局\n_________________") or s=="剪刀" and a=="布"\
elif s=="布" and a=="石头"\ or s=="石头" and a=="剪刀":
or s=="剪刀" and a=="布"\ print("你赢了\n_________________")
or s=="石头" and a=="剪刀":
print("你赢了\n_________________")
else:
print("你输了\n_________________")
else: else:
print("输入错误") print("你输了\n_________________")
\ 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