title: How to display index during list iteration with Django?
body: <p>I am passing a list to a view. My array looks like this: <code>[football, basketball, soccer]</code>. In my view, I would like to display something like this:</p>
  
  <pre><code>1. football
  2. basketball
  3. soccer
  </code></pre>
  
  <p>This means that I would have to iterate through the list that is passed to the array, do a for loop on the elements. How would I do this in the template file?</p>
  
  <p>For each element, I would have to get its index and add 1 to it. Now, I have no idea how to do this in the views. One way I thought about doing this would be to make a dictionary, like so, <code>{'1', 'football': '2', 'basketball': '3', 'soccer'}</code>, but since I already have the data in a list format, I would rather not convert it.</p>