Last active
May 10, 2022 22:36
-
-
Save salluzziluca/81e47250e548f35b4a4b2db3802384e4 to your computer and use it in GitHub Desktop.
add item to dict (value as a number), if key already in dict-> sum.
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
def cargar(diccionario, kkey, value): | |
if key in diccionario.keys(): | |
diccionario[kkey]+=value | |
else: | |
diccionario[kkey]=value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment