Answers for "python generate all possible 2 combinations out of 3 items"

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

Code answers related to "python generate all possible 2 combinations out of 3 items"

Python Answers by Framework

Browse Popular Code Answers by Language