Commit 196ac328 by BellCodeEditor

auto save

parent a722530d
Showing with 9 additions and 6 deletions
import random import random
player=input("请出拳(石头/剪刀/布)") play=input("请出拳(石头/剪刀/布)")
print("玩家出拳:"+player) print("玩家出拳:"+play)
com=["石头","剪刀","布"] com=["石头","剪刀","布"]
coms=random.choice(com) coms=random.choice(com)
print("计算机出拳":"+coms) print("计算机出拳:"+coms)
if coms==play: if coms==play:
print("平局") print("平局")
elif play=="石头"and coms=="剪刀": elif play=="石头" and coms=="剪刀":
print("赢了") print("赢了")
elif play=="剪刀"and coms=="": elif play=="剪刀" and coms=="布":
print("赢了") print("赢了")
elif play==""and coms=="石头": elif play=="布" and coms=="石头":
print("赢了") print("赢了")
else: else:
print("输了") 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