title: python sorting two lists
body: <p>I am trying to sort two lists together:</p>
  
  <pre><code>list1 = [1, 2, 5, 4, 4, 3, 6]
  list2 = [3, 2, 1, 2, 1, 7, 8]
  
  list1, list2 = (list(x) for x in zip(*sorted(zip(list1, list2))))
  </code></pre>
  
  <p>Anyway, doing this gives me on output</p>
  
  <pre><code>list1 = [1, 2, 3, 4, 4, 5, 6]
  list2 = [3, 2, 7, 1, 2, 1, 8]
  </code></pre>
  
  <p>while I would want to keep the initial order for equal number 4 in the first list: what I want is</p>
  
  <pre><code>list1 = [1, 2, 3, 4, 4, 5, 6]
  list2 = [3, 2, 7, 2, 1, 1, 8]
  </code></pre>
  
  <p>What do I have to do? I wouldn't want to use loop for bubble-sorting. Any help appreciated.</p>