title: Finding two smallest values in a list
body: <p>I am trying to return the two smallest values for a numeric list as a tuple.
  However the next code keeps returning first two values of a list.</p>
  <pre><code>def test(): 
    list = [4, 5, 1, 9, -2, 0, 3, -5] 
    min1 = list[0]
    min2 = list[1]
  
    length = len(list)
    
    for i in range(1, length):
      if list[i] &lt; list[0]:
          if list[0] &lt; list[1]:
              list[i] = list[1]
          else:
              list[i] = list[1] 
      else:
          if list[i] &lt; list[1]:
              list[i] = list[1]
      print(min1, min2)
  
      return (min1, min2) 
  
  test()
  </code></pre>
  <p>Console output:</p>
  <pre><code>4,5
  </code></pre>
  <p>Is there any way to do this by iterating?</p>