Invoices merging X10098


Statement
 

pdf   zip

Design a function @fusion_facturas(fact1, fact2)@ which, given two dictionaries @fact1@, @fact2@ that associate product names with their price, returns a dictionary associating product names with their price accumulating both invoices @fact1@ and @fact2@.

Sample session

Sample session
>>> f1 = {'prod1': 1, 'prod2': 2}
>>> f2 = {'prod1': 1, 'prod3': 2}
>>> fus = fusion_facturas(f1, f2)
>>> if fus != {'prod1': 2, 'prod2': 2, 'prod3': 2}: print(fus)
Information
Author
InfBesos
Language
English
Translator
Original language
Spanish
Other languages
Catalan Spanish
Official solutions
Python
User solutions
Python