import numpy as np arrayof_wins = [[11,12,13],[21,22,23],[31,32,33],[11,21,31],[12,22,32],[13,23,33],[11,22,33],[13,22,31]] moves_user = [22, 12, 32] moves_computer = [21,22] result = "" moves_user.sort() moves_computer.sort() founduser = False x = 0 while founduser == False and x <= 7: founduser = (np.allclose(moves_user, arrayof_wins[x])) x += 1 foundcomp = False y = 0 while foundcomp == False and y <= 7: foundcomp = (np.allclose(moves_computer, arrayof_wins[y])) y += 1 if founduser == True: result = "You win!" elif foundcomp == True: result = "Computer wins!" print(result)