Question: PYTHON Problem Statement In this problem, we will experiment with key - value pairs in dictionaries in the context of items in a store and
PYTHON Problem Statement
In this problem, we will experiment with keyvalue pairs in dictionaries in the context of items in a store and their prices.
The first line of input will be an integer N which is greater than representing how many keyvalue pairs are to follow.
Each keyvalue pair is one string line representing the name of the item the key and the next is a float line representing the cost of the item the value
The cost of the item will not exceed Given all of the keyvalue pairs:
Put them into a dictionary
Remove the key,value pair of the cheapest item
Subtract from the price of the most expensive item
Finally, print out the updated dictionary.
Hint: You may need to find minmax values manually, rather than using the builtin min and max functions. Additionally, when deleting values from a dictionary by key, you must delete outside of any forwhile loops.
Sample Input
Bread Milk Eggs
Sample Output
Milk: 'Eggs':
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
