Contact: aviboots(AT)netvision.net.il
39,926 questions
51,859 answers
573 users
from itertools import combinations lst = [2, 7, 9, 5] N = 3 comb = list(combinations(lst, N)) print(comb) ''' run: [(2, 7, 9), (2, 7, 5), (2, 9, 5), (7, 9, 5)] '''