nth item in List to dictionary python
<p>I am trying to create a dictionary from every nth element of a list with list's original index as key. So for example:</p>

<pre><code>l = [1,2,3,4,5,6,7,8,9]
</code></pre>

<p>Now running </p>

<pre><code>dict(enumerate(l)).items() 
</code></pre>

<p>gives me:</p>

<pre><code>dict_items([(0, 1), (1, 2), (2, 3), (3, 4), (4, 5), (5, 6), (6, 7), (7, 8), (8, 9)])
</code></pre>

<p>which is what I want. However the problem begins when I want to now select every second value from l to do this, so I try</p>

<pre><code>dict(enumerate(l[::2])).items() 
</code></pre>

<p>which gives me</p>

<pre><code>dict_items([(0, 1), (1, 3), (2, 5), (3, 7), (4, 9)])
</code></pre>

<p>but I do not want that, I want to preserve the original index when making a dictionary. What is the best way to do this?</p>

<p>I want the following output</p>

<pre><code>dict_items([(0, 1), (2, 3), (4, 5), (6, 7), (8, 9)])
</code></pre>