KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
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 y in range(3): for x in range(3): do_something() for y1 in range(3): for x1 in range(3): do_something_else() would there be an easier way to do this? I know that this code works but when you indent instead of using 2 spaces, like me, it can get to be a problem. Oh in the example there were only 4 nested for loops to make things easier.
Tags (comma-separated)
Save Edits
Cancel