Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # b_to_sort_by_index.py
- d = [('a',9),('b',4),('c',2),('d',7),('e',1),('f',3),('g',6),('h',5),('i',8)]
- d.sort(key=lambda x: x[1])
- print(d)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement