I'm trying to convert the following nested for loops which constructs and prints a list into a recursive function as it would greatly improve the runtime of it. However, I'm having difficulty with this. How could I go about converting it with so many layers of nested loops?
for v in range(-10, 11, 1):
for w in range(-10, 11, 1):
for x in range(-10, 11, 1):
for y in range(-10, 11, 1):
for z in range(-10, 11, 1):
print([v, w, x, y, z])
for (v in range(-10, 11, 1))should befor v in range(-10, 11, 1)I presume. Your point is clear nevertheless.[-4, 0, 7, 1, 7]