Commit a20f0a4d by BellCodeEditor

save project

parent d82e727a
Showing with 10 additions and 7 deletions
import random import random
play=input("出拳(石头/剪刀/布)")
print("cq:"+play)
list=["石头","剪刀","布"] list=["石头","剪刀","布"]
computer=random.choice(list) computer=random.choice(list)
print("电脑出拳"+computer) print("电脑出拳"+computer)
if play==computer: if play in list:
print("平局") if play==computer:
elif(play=="石头" and computer=="剪刀") or (play=="剪刀" and computer=="布") or (play=="布" and computer=="石头"): print("平局")
print("player赢了") elif(play=="石头" and computer=="剪刀") or (play=="剪刀" and computer=="布") or (play=="布" and computer=="石头"):
else: print("player赢了")
print("player输了") else:
\ No newline at end of file print("player输了")
\ 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