An example:
for item in exampleList:
exampleMethod(item) #method will add items to the exampleList
exampleList.remove(item)
This foreach loop will need to iterate through the entire exampleList, whilst items are being added and removed from the exampleList. By the entire exampleList I mean the elements that are added aswell.
I thought one possible way could be by recursion, however, could be a simpler way of doing this?