DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
python dictionary dot product
dot_product = sum(dict_1[key]*dict_2.get(key, 0) for key in dict_1)
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#python
#dictionary
#dot
#product
ADD COMMENT
Topic
COMMENT
Name
2+6 =
Submit