Skip to content
Advertisement

Updating A List Word Counter

I’m creating a program that counts letters. I created two dictionaries that both have the same word and, because they are the same exact word, both have the same counter. I want to know how to merge the two dictionaries so that it updates the counters as well, but I consistently receive the result “NONE.”

JavaScript

Advertisement

Answer

You can concatenate strings and use a single dictionary:

JavaScript

Also please never use a built-in name as a variable name. In your case, you used dict as a variable name

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement