title: sort list with negative numbers
body: <p>I'm trying to sort a list without modifying the existing list or by using built in functions like <code>sort</code> or <code>sorted</code>. I am having trouble when encountering negative numbers. For example sorting the list</p>
  
  <pre><code>[7,1,-5,18]
  </code></pre>
  
  <p>produces</p>
  
  <pre><code>[1, -5, 7, 18]
  </code></pre>
  
  <p>instead of</p>
  
  <pre><code>[-5, 1, 7, 18]
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>lst = [7,1,-5,18]
  b = list()
  init = lst[0]
  for i in range(len(lst)):
      b.append(lst[i])
      if b[i]&lt;init:
          tmp = init
          b[i-1] = b[i]
          b[i] = tmp
  
  print b
  </code></pre>