Question: Write a function findmInormaxDict that extracts the minimum or maximum value of a dictionary. The maximum and minimum should be based on the dictionary's values

 Write a function findmInormaxDict that extracts the minimum or maximum value

Write a function findmInormaxDict that extracts the minimum or maximum value of a dictionary. The maximum and minimum should be based on the dictionary's values by default, but provide an option to instead find the maximum and minimum of the dictionary's keys instead (in the same function). The function should return the maximum or minimum based on a user-provided option. Example inputs and outputs are given below. \# Input {1:5,6:3,10:100,4:5} \# Minimum value 3 \# Maximum value 100 \# Minimum key 1 \# Maximum key 10 H H \# Test your code from above with the example dictionary data ={1:5,6:3,10:100,4:5} H grader. check("q1a") Now modify your function to exit gracefully, i.e. not throw an error, if the input dictionary contains strings. For example, the dictionary {1:3, 'a': 4, 2: 'bcd' } should return nothing. Hint: use the pass operator

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!