title: Python for and if on one line
body: <p>I have a issue with python.</p>
  
  <p>I make a simple list:</p>
  
  <pre><code>&gt;&gt;&gt; my_list = ["one","two","three"]
  </code></pre>
  
  <p>I want create a "single line code" for find a string.</p>
  
  <p>for example, I have this code:</p>
  
  <pre><code>&gt;&gt;&gt; [(i) for i in my_list if i=="two"]
  ['two']
  </code></pre>
  
  <p>But when I watch the variable is wrong (I find the last value of my list):</p>
  
  <pre><code>&gt;&gt;&gt; print i
  three
  </code></pre>
  
  <p>Why does my variable contain the last element and not the element that I want to find?</p>