title: How can I simplify "for x in a for y in b for z in c ..." with the unordered?
body: <pre><code>#!/usr/bin/python
  #
  # Description: I try to simplify the implementation of the thing below.
  # Sets, such as (a,b,c), with irrelavant order are given. The goal is to
  # simplify the messy "assignment", not sure of the term, below.
  #
  #
  # QUESTION: How can you simplify it? 
  #
  # &gt;&gt;&gt; a=['1','2','3']
  # &gt;&gt;&gt; b=['bc','b']
  # &gt;&gt;&gt; c=['#']
  # &gt;&gt;&gt; print([x+y+z for x in a for y in b for z in c])
  # ['1bc#', '1b#', '2bc#', '2b#', '3bc#', '3b#']
  #
  # The same works with sets as well
  # &gt;&gt;&gt; a
  # set(['a', 'c', 'b'])
  # &gt;&gt;&gt; b
  # set(['1', '2'])
  # &gt;&gt;&gt; c
  # set(['#'])
  #
  # &gt;&gt;&gt; print([x+y+z for x in a for y in b for z in c])
  # ['a1#', 'a2#', 'c1#', 'c2#', 'b1#', 'b2#']
  
  
  #BROKEN TRIALS
  d = [a,b,c]
  
  # TRIAL 2: trying to simplify the "assignments", not sure of the term
  # but see the change to the abve 
  # print([x+y+z for x, y, z in zip([x,y,z], d)])
  
  # TRIAL 3: simplifying TRIAL 2
  # print([x+y+z for x, y, z in zip([x,y,z], [a,b,c])])
  </code></pre>
  
  <p><strong>[Update]</strong> A thing missing, what about if you really have <code>for x in a for y in b for z in c ...</code>, i.e. arbirtary amount of structures, writing <code>product(a,b,c,...)</code> is cumbersome. Suppose you have a list of lists such as the <code>d</code> in the above example. Can you get it simpler? Python let us do <code>unpacking</code> with <code>*a</code> for lists and the dictionary evaluation with <code>**b</code> but it is just the notation. Nested for-loops of arbitrary-length and simplification of such monsters is beyond SO, for further research <a href="http://scholar.google.com/scholar?hl=en&amp;q=%2Bunordered+categories&amp;btnG=Search&amp;as_sdt=2000&amp;as_ylo=&amp;as_vis=0" rel="nofollow">here</a>. I want to stress that the problem in the title is open-ended, so do not be misguided if I accept a question!</p>