Home / Expert Answers / Computer Science / a-write-a-program-in-python-to-get-the-minimum-and-maximum-values-held-in-a-dictionary-assuming-pa885

(Solved): (a) Write a program in Python to get the minimum and maximum values held in a dictionary, assuming ...



(a) Write a program in Python to get the minimum and maximum values held in a dictionary, assuming that the dictionary contai

(a) Write a program in Python to get the minimum and maximum values held in a dictionary, assuming that the dictionary contains numerical values. Provide the code and the output of the program running as text. [2] (b) Write a program in Python to detect if a dictionary contains two values that are the same. Provide the code and the output of the program running as text. (c) There is a dictionary containing all student grades for a course. The dictionary contains a unique student ID and corresponding grade for each student as follows: \( \{12324: 45,4324324: 90\} \) Create a new dictionary mapping for degree classifications with specific grade bounds. For reference, a 1st is a grade over 69. A 2:1 is a grade in the range 60-69. A \( 2: 2 \) is between 50-59. A 3rd class degree is between 40-49 and everything below 40 is a fail. (d) Write a function in Python that is capable of returning all words from a list which are longer than six characters. Write a list comprehension and a loop based version showing words greater than six characters. Run it on your machine with a large random test data array. Can you identify any significant differences in speed? (e) Provide three reasons why time data is difficult to process. (f) Provide two examples of Python code to handle HTTP status codes.


We have an Answer from Expert

View Expert Answer

Expert Answer


A) def getMinAndMax(dict): min = dict[0] max = dict[0] for in range(1, len(dict)): min = dict[i] if dict[i] < min: elif dict[i]> max: max = dict[i] return min, max dict = {'a': 100, 'b':200, 'c':300} print(getMinAndMax(dict)) output- (100, 300) Expla
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe