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)]

Here is what the above code is Doing:
1. We create a list of tuples, where each tuple contains the elements of the lists a and b.
2. We use the itertools.product function to create the list of tuples.
3. We print the list of tuples.

As you can see, the itertools.product function takes two lists as input and returns a list of tuples.

In this example, we have two lists: a and b. The itertools.product function takes these two lists and returns a list of tuples. Each tuple contains the elements of the lists a and b.

In this example, we have two lists: a and b. The itertools.product function takes these two lists and returns a list of tuples. Each tuple contains the elements of the lists a and b.

The itertools.product function is a useful tool for creating lists of tuples. You can use it to create lists of tuples from two or more lists.