DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
python - subtracting dictionary values
d3 = {key: d1[key] - d2.get(key, 0) for key in d1}
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#python
#subtracting
#dictionary
#values
ADD COMMENT
Topic
COMMENT
Name
8+8 =
Submit