title: how do I put the statement result in a list?
body: <p>I am trying to save the 'yes' or 'no' results into a list that is named as outlier here.</p>
  <p>This is my code</p>
  <pre><code>d = {'col1': [1, 2, 3, 4, 5], 'Spread': [10, 10.8, 5.0, 4.9,12.3]}
  df = pd.DataFrame(d)
  upper_limit = 9
  
  rows = df.index.tolist()
  outlier = []
  for i in rows:
      if df.Spread[i]&gt;upper_limit:
          result = print('yes') in outlier
      else:
          result = print('no') in outlier
           
  </code></pre>
  <p>and my output is like this</p>
  <pre><code>yes
  yes
  no
  no
  yes
  </code></pre>
  <p>after this loop, if I print outlier, it will only return to an empty list.
  What did I go wrong at this stage?
  How do I save 'yes' or 'no' results in the list?</p>
  <p>Thanks in advance!</p>
  <p>updated!</p>
  <pre><code></code></pre>