I have a code snippet like this in Python:
#list_1 have a previous value that we dont know
n = 40 #This value can change
list_2 = [0, 0, 0, 0]
#We are trying all the values possibles for 4 positions and 40 different numbers
for a in range(n):
for b in range(n):
for c in range(n):
for d in range(n):
list_2[0] = a
list_2[1] = b
list_2[2] = c
list_2[3] = d
if list_1 == list_2:
print("Ok")
I want to change the nested for loops into something simpler; what can I do?