SHARE
TWEET

Untitled

a guest Jun 16th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. nomes = [{'nome': 'joao', 'sobrenome' 'alves'},{'nome': 'joao', 'sobrenome' 'silva'}]
  2.      
  3. nomes = [{'nome': 'marcelo', 'sobrenome': 'alves'},
  4.         {'nome': 'joao', 'sobrenome': 'tavares'},
  5.         {'nome': 'joao', 'sobrenome': 'alves'},
  6.         {'nome': 'joao', 'sobrenome': 'nogueira'},
  7.         {'nome': 'joao', 'sobrenome': 'silva'},
  8.         {'nome': 'barbara', 'sobrenome': 'wilson'},
  9.         {'nome': 'antonio', 'sobrenome': 'silva'}]
  10.  
  11. nomes.sort(key = lambda i: i['sobrenome'], reverse = True)
  12. nomes.sort(key = lambda i: i['nome'])
  13.  
  14. [print("{:10} {:10}".format(item['nome'], item['sobrenome'])) for item in nomes]
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