"""
product 笛卡尔积
permutations 排列
combinations 组合,没有重复
combinations_with_replacement 组合,有重复
用itertools.都一个立马搞定,无需多层循环

"""

# 以下完成0,1,2,3,4,5,6,7,8,9排列不重复的个数

import itertools
data=[]
for i in itertools.permutations('1234567890',10):
    if i[0] !='0':
        data.append("".join(i))

print(len(data))

 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-16
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-10
  • 2021-08-24
  • 2022-12-23
  • 2021-08-07
相关资源
相似解决方案