求1、2、3、4、5、6六个数组成不排序不重复的4位组合。
1234和2134也算重复。
from itertools import combinations t=[''.join(x) for x in list(combinations("123456", 4))] print(t)
['1234', '1235', '1236', '1245', '1246', '1256', '1345', '1346', '1356', '1456', '2345', '2346', '2356', '2456', '3456']