Answers for "how to make possible combination in list in 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
1

python get all combinations of list

itertools.combinations(iterable, r)
Posted by: Guest on January-29-2021

Code answers related to "how to make possible combination in list in python"

Python Answers by Framework

Browse Popular Code Answers by Language