Michael J. answered 06/08/19
Mathematics and Computer Programming for Gifted Students
You should not remove data from a structure over which you are iterating. Removing the current data may disrupt the __next__() function and prevent the for loop from reaching the raising of StopIteration which results in an infinite loop.
Instead you have two options.
First, you can iterate over a range that is the length of the list of tuples, but you must use a while loop and each time that you remove a tuple be sure to subtract 1 from the index to account for the change to the structure. This is the most memory efficient method.
Second, instead of removing tuple you can copy the other tuples to a new list. This would be a great place to use list comprehension.
I'm happy to help guide you through this process.