title: Python 2.7: How would I go about creating a dictionary that maps the first n numbers to their respective squares or cubes?
body: <p>I currently have this piece of code (for squares), but it doesn't seem to be working correctly:</p>
  
  <pre><code>    for n in range(len(dict)): 
         if n == 0:
            pass
         else:
            squares = (n*n)
      dict[n]=squares
  </code></pre>