Guest User

Untitled

a guest
Apr 16th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. >>> a_dict = {'aa1':'n','ba2' : 'a','aa2':'a'}
  2. >>> a_dict
  3. {'ba2': 'a', 'aa1': 'n', 'aa2': 'a'}
  4.  
  5. >>> b_tuple = sorted(a_dict.items(),key = lambda x: x[1])
  6. >>> b_tuple
  7. [('ba2', 'a'), ('aa2', 'a'), ('aa1', 'n')]
Add Comment
Please, Sign In to add comment