title: Getting index of item while processing a list using map in python
body: <p>While processing a list using map(), I want to access index of the item while inside lambda. How can I do that?</p>
  
  <p>For example</p>
  
  <pre><code>ranked_users = ['jon','bob','jane','alice','chris']
  user_details = map(lambda x: {'name':x, 'rank':?}, ranked_users)
  </code></pre>
  
  <p>How can I get rank of each user in above example?</p>