I have four different lists. headers
, descriptions
, short_descriptions
and misc
. I want to combine these into all the possible ways to print out:
header\n
description\n
short_description\n
misc
like if i had (i'm skipping short_description and misc in this example for obvious reasons)
headers = ['Hello there', 'Hi there!']
description = ['I like pie', 'Ho ho ho']
...
I want it to print out like:
Hello there
I like pie
...
Hello there
Ho ho ho
...
Hi there!
I like pie
...
Hi there!
Ho ho ho
...
What would you say is the best/cleanest/most efficent way to do this? Is for
-nesting the only way to go?
Enter the formula =List1. Expand out the new List1 column and then Close & Load the query to a table. The table will have all the combinations of items from both lists and we saved on making a custom column in List1 and avoided using a merge query altogether!
In the formula of combinations without repetition, input the values: C ( n , r ) = n ! That's it! That's how you calculate the number of combinations without repetition.
There are 10,000 possible combinations that the digits 0-9 can be arranged into to form a four-digit code.
Is this what you're looking for? http://docs.python.org/library/itertools.html#itertools.product
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With