Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q3.2 Shopping Lists You are given two shopping lists (with items and quantity), one from your mom and one for yourself: - mom's list: banana

image text in transcribed

Q3.2 Shopping Lists You are given two shopping lists (with items and quantity), one from your mom and one for yourself: - mom's list: banana 5 , avacodo 8, eggs 12 , milk 2 , orange 6 - your list: Red Bull 12, potato chips 5, pineapple 3 , eggs 6 , avacodo 4 Please construct two dictionaries, one for each shopping list. ]: Q3.3 Merging the Shopping Lists You realize there are some overlapping items on the lists, so you decide to merge the two. Please write a function, merge_shop_list(a, b), that takes two dictionaries a and b as inputs, and merge them together. If there is a common item, you should add the quantities together. The function shall return the merged dictionary (or the shopping list). Show your result by printing the merged shopping list

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions

Question

LO5 Highlight five external recruiting sources.

Answered: 1 week ago