python get all combinations of list
itertools.combinations(iterable, r)
python get all combinations of list
itertools.combinations(iterable, r)
python combinations
import itertools
def subs(l):
res = []
for i in range(1, len(l) + 1):
for combo in itertools.combinations(l, i):
res.append(list(combo))
return res
python possible combinations
import math
n=7
k=5
print(math.comb(n, k))
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us