1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| import random
shitou = 1 bu = 2 jiandao = 3 d = random.randint(1,3) e = int(input("请输入你要出的手势\n 1.石头 2.布 3.剪刀"))
if d == e: exit('平局') if d == 1: d += e print("电脑出的是石头") if d == 3: print("你赢了") exit() else: print("你输了") exit() if d == 2: print("电脑出的是布") d += e if d == 5: print("你赢了") exit() else: print("你输了") exit() if d == 3: print("电脑出的是剪刀") d += e if d == 4: print("你赢了") exit() else: print("你输了") exit()
|