Question
You have been given the following lists of students and their test scores: names = [joe, tom, barb, sue, sally] scores=[10, 23, 13, 18, 12]
You have been given the following lists of students and their test scores: names = [joe, tom, barb, sue, sally] scores=[10, 23, 13, 18, 12] (8 pts) Write a function makeMixedList, that takes 2 lists and returns 1 list that combines the names with the scores, like this: [joe, 12, tom, 23, ...etc...]. Of course, this should work for any 2 lists that you give the function. (10 pts) Write a function, makeDictionary, that takes the 2 lists and returns 1 dictionary with the names as the keys and the scores as the values. Assign the result of makeDictionary to scoreDict which will be used in the exercises that follow. (5 pts) Using scoreDict, find the score for barb. (2 pts) What instruction(s) would you use to add a new person to the new dictionary, john and his score of 19? (2 pts) Create a sorted list of all the scores in scoreDict. (2 pts) Calculate the average of all the scores in scoreDict. (2 pts) What instruction(s) would you use to update the score for sally to be 13? (3 pts) Tom has just dropped this class. Delete tom and his score from scoreDict. (6 pts) Print out a table of students and their scores with the students listed in alphabetical order
I KNOW HOT TO DO ALL THE PROBLEM EXCEPT THE LAST ONE: PRINT OUT A TABLE OF STUDENTS AND THEIR SCORES WITH THE STUDENTS LISTED IN ALPHABETICAL ORDER. CAN SOMEONE HELP THANKS SO MUCH!
:)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started