Trying to combine (concatenate) elements from 3 lists into one, new list
Question: I have 3 lists that contain Town, Range and Section (These are also the names
of the lists) information. For example, List Town has 'N14'...'N20', List
Range has 'E4'...'E7' and List Section has '01'...'36'. I want to be able to
put all possible combinations from the three lists into one new list, named
AOI, like this 'N14E401'....'N20E732' (727 possible combinations). This is for
a arcpy script that is already written, and working, that will use raw_input
prompts (the above combinations) that will be then used as the AOI that will
do some geoprocessing (not important as that part of the script works fine). I
just want to make the AOI selection easier as the way I have it set up now,
the user must input the Town, Range and Section information as individual
raw_inputs in three separate steps.

Thanks in advance. I would have put this on the arcpy specific area but it
seems more of a python question than an arcpy question. I am a complete python
noob and have been teaching myself scripting so...be gentle, kind readers.


Answer: What you are trying to achieve is the [Cartesian
product](http://en.wikipedia.org/wiki/Cartesian_product) of 3 lists. This can
easily be achieved by using
[itertools.product](http://docs.python.org/2/library/itertools.html#itertools.product)

Off-course you would not get the O/P as you depicted instead you will get a
list of tuples, but then again joining the list of tuples would be trivial.
For each of the tuples you need to invoke
[str.join](http://docs.python.org/2/library/stdtypes.html#str.join)

You may either want to loop through the tuples, join the list while
[incrementally appending
](http://docs.python.org/2/tutorial/datastructures.html), or better use [List
comprehension](http://docs.python.org/2/tutorial/datastructures.html#list-
comprehensions)

