Commit de36985f by BellCodeEditor

save project

parent 3cd5ecef
Showing with 8 additions and 6 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)
if plar == computer:
print("平局") print("平局")
elif plar=="布" and computer=="石头" or plar=="剪刀" and computer=="布" or plar=="石头" and computer=="剪刀": elif plar=="布" and computer=="石头" or plar=="剪刀" and computer=="布" or plar=="石头" and computer=="剪刀":
print("你赢了") print("你赢了")
else: else:
print("输入错误") 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