1. 使用 itertools
import itertools aa = list(itertools.combinations([1,2,3,4],3)) print aa print aa.__len__() print aa[0] print aa[0][2] bb = [1,3,45,6,7,34,8,12,13,15] print bb
运行结果: