title: How does Map work
body: <p>I have a line of code which is:</p>
  
  <pre><code>D = {'h' : 'hh' , 'e' : 'ee'}
  str = 'hello'
  data = ''.join(map(lambda x:D.get(x,x),str))
  print data
  </code></pre>
  
  <p>this gives an output -> hheello</p>
  
  <p>I am trying to understand how does map function work here. Does map take each character of
  the string and compare it with dictionary key, and give back the corresponding key value?</p>
  
  <p>How does it do for each character here? There is no iteration. Is there any good example to understand this better?</p>