您可以使用itertools:
from itertools import product nums = [10, 100] n = 3 ans = list(product(nums, repeat=n)) print(ans)