for iteration in range(len(list) - 1): index = iteration +1 #This is the line which has no effect on the inner loop for index in range(len(list)): if list[it
Try this instead:
for index in range(iteration + 1, len(l)): # don't use "list" as a name
index is being reassigned anyway within the for-loop so index = iteration + 1 is not having any effect.
index
for
index = iteration + 1