Created
January 15, 2020 19:12
-
-
Save luanjpb/ef808b13776676bbedbd97099c25d582 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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