Question: Write a function referencing the parameter dct to perform the following operations. Run the function using the dictionary called inventory as an argument.
Write a function referencing the parameter dct to perform the following operations. Run the function using the dictionary called "inventory" as an argument.
Start by printing the original dictionary:
iphone: 'ipad': 'macbook': 'monitor':
a Add the key value pair "stylus": and print the result.
iphone: 'ipad': 'macbook': 'monitor': 'stylus':
b Change the ipad inventory to then print the result.
iphone: 'ipad': 'macbook': 'monitor': 'stylus':
c Remove the key value pair, "monitor": then print the result.
iphone: 'ipad': 'macbook': 'stylus':
d Extract each of the values in the dictionary and add them to the list called counts. Print the counts list.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
