Commit de36985f by BellCodeEditor

save project

parent 3cd5ecef
Showing with 10 additions and 8 deletions
...@@ -3,14 +3,16 @@ plar=input("请出拳(石头/剪刀/布)") ...@@ -3,14 +3,16 @@ plar=input("请出拳(石头/剪刀/布)")
print("我出"+plar) print("我出"+plar)
import random import random
list=["石头","剪刀","布"] list=["石头","剪刀","布"]
computer=random.choice(list) if plar in list
print("计算机出:"+computer) computer=random.choice(list)
if plar == computer: print("计算机出:"+computer)
print("平局") if plar == computer:
elif plar=="布" and computer=="石头" or plar=="剪刀" and computer=="布" or plar=="石头" and computer=="剪刀": print("平局")
print("你赢了") elif plar=="布" and computer=="石头" or plar=="剪刀" and computer=="布" or plar=="石头" and computer=="剪刀":
else: print("你赢了")
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