Advertisement
here2share

# list_sort_arrays_by_indexed_item.py

May 29th, 2015
368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.18 KB | None | 0 0
  1. # list_sort_arrays_by_indexed_item.py
  2.  
  3. data = [(4,5,'fifth'),(0,2,'second'),(1,4,'fourth'),(2,3,'third'),(3,1,'first')]
  4. data = sorted(data, key = lambda x:x[1])
  5. for i in data:
  6.     print i
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement