In my code below, 'single' refers to a finite list. I then need to get all possible pairs from this list; however, the program didn't finish executing.
After messing around with some print statements, for some reason, despite 'single' having a finite number of elements (13122; I checked with len()) the for loop was running forever, until I but a break statement in which forcibly ends the loop when the index gets too high. Initially I thought this was because I was referencing over 'single' twice; however, even when I replaced 'single' with copy.deepcopy(single), the same problem occurred, and my fix no longer worked.
If it is of any help, the elements of 'single' are themselves lists.
'''
for index1, i in enumerate(single):
for index2, j in enumerate(single):
return_list.append([i,j])
if (index1 > length):
break
'''