Answers for "all combinations in a list python"

6

get all combinations from two lists python

a = ["foo", "melon"]
b = [True, False]
c = list(itertools.product(a, b))
>> [("foo", True), ("foo", False), ("melon", True), ("melon", False)]
Posted by: Guest on April-21-2020
0

python possible combinations

import math
n=7
k=5
print(math.comb(n, k))
Posted by: Guest on October-01-2021

Code answers related to "all combinations in a list python"

Python Answers by Framework

Browse Popular Code Answers by Language