fork download
  1. data = ['Joao', '83889023', 'Maria', '81944356', 'Marcos', '32258899', 'Ana', '88235423', 'George', '1254345', 'Rafaela', '8899345671', 'Pedro', '83223345', 'Aline', '842234565', 'Carlos', '83554463', 'Julia', '13565446', 'Murilo', '23543646', 'Mayra', '233253425', 'Italo', '842142543', 'Rita', '3253464457', 'Aldo', '77443456', 'Raquel', '8384423553', 'Henrique', '88342235', 'Joyce', '987676342', 'Daniel', '3253456346', 'Livia', '325346634', 'Pablo', '87461723', 'Carla', '87351236']
  2.  
  3. def pairwise(iterable):
  4. it = iter(iterable)
  5. return zip(it, it)
  6.  
  7. name_map = {number: name for name, number in pairwise(data)}
  8.  
  9. print(name_map)
Success #stdin #stdout 0.04s 9328KB
stdin
Standard input is empty
stdout
{'8899345671': 'Rafaela', '87351236': 'Carla', '13565446': 'Julia', '32258899': 'Marcos', '77443456': 'Aldo', '87461723': 'Pablo', '3253464457': 'Rita', '8384423553': 'Raquel', '23543646': 'Murilo', '81944356': 'Maria', '83223345': 'Pedro', '842142543': 'Italo', '325346634': 'Livia', '842234565': 'Aline', '987676342': 'Joyce', '1254345': 'George', '3253456346': 'Daniel', '88235423': 'Ana', '83889023': 'Joao', '233253425': 'Mayra', '88342235': 'Henrique', '83554463': 'Carlos'}