import itertools
'''
#product笛卡尔积(有放回的抽样排列)
for i in itertools.product('ABCD',repeat=2):
print(i)
'''
'''
#permutations排列(不放回抽样排列)
for i in itertools.permutations('ABCD',2):
print(i)
'''
'''
#combinations 组合,没有重复(不返回抽样组合)
for i in itertools.combinations('ABCD',2):
print(i)
'''
#combinations_with_replacement 组合,有重复(有放回抽样组合)
for i in itertools.combinations_with_replacement('ABCD',2):
print(i)