Show transcribed image text 1. You have been given the following lists of students and their test scores: names=[‘joe’,’tom’,’barb’,’sue’,?’sally’] scores[10,23,13,l8,12] Write a function, makeDictionary, that takes the two lists and returns a dictionary with the names as the key and the scores as the values. Assign the result of makeDictionary to scoreDict. Using scoreDict, find the score for ?barb?. Add a score of 19 for ?john?. Create a sorted list of all the scores in scoreDict. Calulate the average of all the scores in scoreDict Update the score for ?sally? to be 13. Tom has just dropped this class. Delete ?tom? and his score from ScoreDict. Print out a table of students and their scores with the students listed in alphabetical order. 2 Although Python provides us with many list methods, it is good practice and very instructive to think about how they ae implemented. Implement a Python function that works like the following: 1. count 2. inList – return True if item is in list 3. reverse 4. find 5. insert 3. Write a function shuffle that takes a list and returns a new list with the elements shuffled into a random order. 4. Suppose you have a list of key-score values like the following: [(‘john’,10), ‘?bob’,8). (‘john’,5), (‘bob’,17),…] Write a function that takes such a list as a parameter and prints out a table of average scores for each person. 5. Another way to compute the frequency table is to obtain a list of key-value pairs using the items method. This list of flip can be sorted and printed without returning to the original dictionary. Rewrite the frequency table function using this idea.
The post Write a function, makeDictionary appeared first on My Assignment Online.