Skip to content

Instantly share code, notes, and snippets.

@luanjpb
Created January 15, 2020 19:12
Show Gist options
  • Save luanjpb/ef808b13776676bbedbd97099c25d582 to your computer and use it in GitHub Desktop.
Save luanjpb/ef808b13776676bbedbd97099c25d582 to your computer and use it in GitHub Desktop.
lista_1 = ['a', 'b', 'c', 'a']
lista_2 = [1,2,3,4]
dicio = {}
for key, value in zip(lista_1, lista_2):
if key in dicio:
dicio[key] = [dicio[key]] + [value]
else:
dicio[key] = value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment