fork download
  1. L = [('Bob', 75), ('Adam', 92), ('Bart', 66), ('Lisa', 88)]
  2.  
  3. def by_name(t):
  4. return sorted(t[0].lower())
  5.  
  6. L2 = sorted(L, key=by_name)
  7. print(L2)
  8.  
  9. # your code goes here
  10. # your code goes here
Success #stdin #stdout 0.07s 14140KB
stdin
Standard input is empty
stdout
[('Adam', 92), ('Bart', 66), ('Lisa', 88), ('Bob', 75)]