title: Python: How to perform a secondary descending alphabetic sort within a numeric primary sort
body: <p>In <a href="https://stackoverflow.com/questions/5212870/sorting-a-python-list-by-two-criteria">Sorting a Python list by two criteria</a> Fouad gave the following answer:</p>
  
  <pre><code>sorted(list, key=lambda x: (x[0], -x[1]))
  </code></pre>
  
  <p>I'd like to sort the following list primarily on the list of tuples primarily on the second item in each element in ascending order, followed by the first (alphabetic) item in descending order:</p>
  
  <pre><code>[('Ayoz', 1, 18, 7), ('Aidan', 2, 4, 9), ('Alan', 2, 4, 9), ('Arlan', 5, 6, 7), ('Luke', 15, 16, 2), ('Tariq', 5, 4, 2)] 
  </code></pre>
  
  <p>to give the answer:</p>
  
  <pre><code>[('Ayoz', 1, 18, 7), ('Alan', 2, 4, 9), ('Aidan', 2, 4, 9), ('Tariq', 5, 4, 2), ('Arlan', 5, 6, 7), ('Luke', 15, 16, 2)]
  </code></pre>
  
  <p>using the above approach if possible .
  I tried </p>
  
  <pre><code>tlist = [('Ayoz', 1, 18, 7), ('Aidan', 2, 4, 9), ('Alan', 2, 4, 9), ('Arlan', 5, 6, 7), ('Luke', 15, 16, 2), ('Tariq', 5, 4, 2)]
  sorted(tlist, key=lambda elem: (elem[1], -elem[0]))
  </code></pre>
  
  <p>but that only works when elem[0] is numeric (in this case it gives a TypeError: bad operand type for unary -: 'str')</p>
  
  <p>I'll be grateful for any help. Python version is 3.4</p>