''' 石头(1) 剪刀(2) 布(3) 电脑赢:1-2,2-3,3-1 平局:1-1, 2-2,3-3 我赢:1-3,2-1,3-2 ''' import random user = int(input("请输入猜拳数字 石头(1) 剪刀(2) 布(3): ")) # computer 是一个int类型 computer = random.randint(1, 3) print(computer, "-", user) if user == computer: print("平局") elif (computer == 1 and user == 3) or (computer == 2 and user ==1) or (computer ==3 and user == 2): print("用户赢") else: print("电脑赢")