title: How to convert a list to a dictionary with indexes as values?
body: <p>I am trying to convert the following list:</p>
  <pre><code>l = ['A', 'B', 'C']
  </code></pre>
  <p>To a dictionary like:</p>
  <pre><code>d = {'A': 0, 'B': 1, 'C': 2}
  </code></pre>
  <p>I have tried answers from other posts but none is working for me. I have the following code for now:</p>
  <pre><code>d = {l[i]: i for i in range(len(l))}
  </code></pre>
  <p>Which gives me this error:</p>
  <pre><code>unhashable type: 'list'
  </code></pre>