What you want to do is iterate over a product. Use itertools.product.
import itertools
ranges = [range(x1, x2), range(x3, x4), ...]
for xs in itertools.product(*ranges):
f(*xs)
Example
import itertools
ranges = [range(0, 2), range(1, 3), range(2, 4)]
for xs in itertools.product(*ranges):
print(*xs)
Output
0 1 2
0 1 3
0 2 2
0 2 3
1 1 2
1 1 3
1 2 2
1 2 3