title: Python: for loop in index assignment
body: <p>While working through the awesome book "Programming Collective Intelligence", by Toby Segaran, I've encountered some techniques in index assignments I'm not entirely familiar with.</p>
  
  <p>Take this for example:</p>
  
  <pre><code>createkey='_'.join(sorted([str(wi) for wi in wordids]))
  </code></pre>
  
  <p>or:</p>
  
  <pre><code>normalizedscores = dict([(u,float(l)/maxscore) for (u,l) in linkscores.items()])
  </code></pre>
  
  <p>All the nested tuples in the indexes have me a bit confused.  What is actually being assigned to these varibles?  I assumed obviously the <code>.join</code> one comes out as a string, but what about the latter?  If someone could explain the mechanics of these loops I'd really appreciate it.  I assume these are pretty common techniques, but being new to Python, I suppose to ask is a moment's shame.  Thanks!</p>