python strange looking loop
<pre><code>      char_rdic = list('helo')
      char_dic = {w:i for i ,w in enumerate(char_rdic)}
</code></pre>

<p>I'm not really sure what this code actually do. what does w and i represent  in this code?  </p>

<p>This code creates <code>char_dic</code> dictionary with chars from <code>'helo'</code> string as keys and their occurence indexes in given string.
<code>i</code> is an index of <code>w</code> element in <code>char_rdic</code> list.</p>

python