Created
October 5, 2020 06:25
-
-
Save pulkitpahwa/7d548e27247f4b554915b4d346847711 to your computer and use it in GitHub Desktop.
Naive process of summing 2 dictionaries
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
# continued from https://gist.github.com/pulkitpahwa/a42aaafa4d6290a453299cec6bce64fc | |
sum_may_june_2020 = {} | |
for car, units_sold in may_2020.items(): | |
sum_may_june_2020[car] = sum_may_june_2020.get(car, 0) + units_sold | |
for car, units_sold in june_2020.items(): | |
sum_may_june_2020[car] = sum_may_june_2020.get(car, 0) + units_sold |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment