python 排列组合
import itertools
#排列
list1 = list(itertools.permutations([1,2,3,4,5,6],2))
# print(list1)
print(len(list1))
# list2 = itertools.permutations([1,2,3,4,5,6],2)
# print(tuple(list2))
#组合
list3 = list(itertools.combinations([1,2,3,4,5,6],2))
# print(list3)
print(len(list3))
#排列组合
list4 = list(itertools.product([1,2,3,4,5,6,7,8,9,0],repeat=3))
# print(list4)
print(len(list4))
我们之间的距离很近,但又很遥远