私信  •  关注

Perplexabot

Perplexabot 最近创建的主题
Perplexabot 最近回复了
4 年前
回复了 Perplexabot 创建的主题 » 如何在python中生成两个值为n的数字的所有可能的置换?

您可以使用itertools:

from itertools import product

nums = [10, 100]
n = 3

ans = list(product(nums, repeat=n))
print(ans)