List comprehension variable not defined? (Python) : <p>I have a list of dicts sortd, i want to add the first three dicts in the list to a new list. </p>

<p>I tried using a list comp for the first time but when doing:</p>

<pre><code>new_dict = [pair for pair[0:3] in sortd]
</code></pre>

<p>i get the error "pair is not defined", what am i doing wrong here? </p>
