This problem has been getting at me for a while now. Is there an easier way to write nested for loops in python? For example if my code went something like this
for
When faced with that sort of program logic, I would probably break up the sequence of loops into two or more separate functions.
Another technique in Python is to use list comprehensions where possible, instead of a loop.