from itertools import cycle fizz = cycle(["","","fizz"]) buzz = cycle(["","","","","buzz"]) for z in zip(fizz,buzz): print(f"{z[0]}{z[1]}")
Fizzbuzz is probably the perfect fit, which is sad since it is a synthetic problem. I did find one problem once where I could save about 30s of user waiting time by generating (had to be done dynamically) wheels in the 3-10k element range.