You can use generators to simplify nested loops and make it easier to break out of them.
There's 10 types of people in the world, those who know binary and those who don't.