it.product+列表查询(Py)
2025-07-13 14:31:35
发布于:浙江
1阅读
0回复
0点赞
from itertools import product
pd=list(product(*[[0,1,2,3,4,5,6,7,8,9] for i in range(4)]))
pd=[i for i in pd if i[0]!=i[1] and i[0]!=i[2] and
i[0]!=i[3] and i[1]!=i[2] and i[1]!=i[3] and i[2]!=i[3]]
n=int(input())
print(*pd[n])
这里空空如也
有帮助,赞一个