I often find myself doing this:
for x in range(x_size): for y in range(y_size): for z in range(z_size): pass # do something here
It depends on what is inside the loop. If dealing with lists, you may be able to use a list comprehension
For the more general case, see this post on itertools.