You can use generators to simplify nested loops and make it easier to break out of them.
Whenever I create something new, I share it with my mailing list of loyal readers. You can subscribe it too!