does anybody know how can I find out all the possible combinations of a given list using Python 3?
My lists look like this:
usersArray = ["John", "Mike", "Robert", "Tom"]
foodsArray = ["hamburger", "cake", "cheese"]
I would like to have something like this:
Johnhamburger
Mikehamburger
Roberthamburger
Tomhamburger
Johncake
Mikecake
Robertcake
Tomcake
Johncheese
Mikecheese
Robertcheese
Tomcheese
#and then the opposite
hamburgerJohn
hamburgerMike
hamburgerRobert
hamburgerTom
cakeJohn
...
...
...
cheeseJohn
...
...
...
Can I use itertools
?
Thank you!