Question: Q2. Given two lists shown as Figure 2(a). The first list is a name list and the second one is a list of dictionaries
Q2. Given two lists shown as Figure 2(a). The first list is a name list and the second one is a list of dictionaries which stores the scores of two students, "Tom" and "Jerry", in three subjects "S1", "S2", and "S3". Please write python program to complete the following tasks. < name = ["Tom", "Jerry"] score = [{"S1":89, "S2":76,"S3":95},{"S1":48,"S2":96,"S3":84}] Figure 2(a) original lists a. Merge the two lists into a nested dictionary as shown in Figure 2(b) and print the dictionary. < {'Tom': {'S1': 89, 'S2': 76, 'S3': 95}, 'Jerry': {'S1': 48, 'S2': 96, 'S3': 84}} Figure 2(b) dictionary exmple < b. Print the merged dictionary line by line, and print the minimum score of each student shown as Figure2(c). < Tom S1 : 89 S2 : 76 S3: 95 The minimum score of Tom is 76 Jerry S1 : 48 S2: 96 S3 84 The minimum score of Jerry is 48 Figure 2(c) line by line output example
Step by Step Solution
3.40 Rating (153 Votes )
There are 3 Steps involved in it
Explanation In this section we begin with two distinct sets of data names which encompasses the names of students and scores which consists of diction... View full answer
Get step-by-step solutions from verified subject matter experts
