Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> a_dict = {'aa1':'n','ba2' : 'a','aa2':'a'}
- >>> a_dict
- {'ba2': 'a', 'aa1': 'n', 'aa2': 'a'}
- >>> b_tuple = sorted(a_dict.items(),key = lambda x: x[1])
- >>> b_tuple
- [('ba2', 'a'), ('aa2', 'a'), ('aa1', 'n')]
Add Comment
Please, Sign In to add comment