daily pastebin goal
3%
SHARE
TWEET

Untitled

a guest Apr 16th, 2018 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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')]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top