Commit c37f120a by BellCodeEditor

save project

parent d3524c2c
Showing with 11 additions and 8 deletions
......@@ -2,12 +2,16 @@ import random
# 玩家出拳
player=input("请出拳(石头;剪刀;布)")
print("玩家出拳:"+player)
list = ["剪刀","石头","布"]
cmp=random.choice(list)
print("电脑出拳"+cmp)
if player==cmp:
print("平局")
elif player=="剪刀" and cmp=="布 " or player=="石头" and cmp=="剪刀 "or player=="布" and cmp=="石头":
print("win")
if player in list:
cmp=random.choice(list)
print("电脑出拳"+cmp)
if player==cmp:
print("平局")
elif player=="剪刀" and cmp=="布 " or player=="石头" and cmp=="剪刀 "or player=="布" and cmp=="石头":
print("win")
else:
print("lose")
else:
print("lose")
\ No newline at end of file
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