Use the provided data to make a new dictionary (solution must be dictionary data type) with the same keys as in
studentDataScores and values that represent the average of each student’s four test grades.
call it
newDict=
studentDataScores = {('Will','male','junior'):[0.81,0.75,0.74,0.8],
('Tom','male','senior'):[0.87,0.79,0.81,0.81],
('Donald','male','junior'):[0.82,0.77,0.8,0.8],
('Trey','male','senior'):[0.86,0.78,0.77,0.78],
('John','male','junior'):[0.74,0.81,0.87,0.73],
('Pat','male','senior'):[0.9,0.82,0.94,0.79],
('Rick','male','senior'):[0.8,0.88,0.87,0.88],
('Jorge','male','sophomore'):[0.66,0.76,0.79,0.76],
('Tripp','male','senior'):[0.81,0.78,0.8,0.89],
('Ed','male','senior'):[0.81,0.87,0.88,0.84],
('Erik','male','junior'):[0.76,0.73,0.83,0.76],
('Wallard','male','sophomore'):[0.7,0.8,0.79,0.8],
('Ron','male','senior'):[0.76,0.78,0.82,0.83],
('Perrie','male','junior'):[0.83,0.87,0.77,0.75],
('Rob','male','senior'):[0.92,0.8,0.82,0.84],
('Thomas','male','junior'):[0.76,0.72,0.8,0.72],
('Mark','male','senior'):[0.87,0.79,0.81,0.83],
('Filipe','male','junior'):[0.77,0.81,0.74,0.75],
('Dean','male','senior'):[0.78,0.8,0.8,0.8],
('Sampson','male','senior'):[0.8,0.89,0.82,0.87],
('Aleck','male','senior'):[0.86,0.79,0.87,0.8],
('Gene','male','junior'):[0.79,0.72,0.78,0.72],
('Ki','male','senior'):[0.83,0.79,0.9,0.8],
('Fei','male','junior'):[0.75,0.72,0.8,0.81],
('Hung','male','senior'):[0.86,0.91,0.84,0.9],
('Chen','male','senior'):[0.76,0.77,0.84,0.88],
('Lei','male','senior'):[0.84,0.86,0.78,0.88],
('Kang','male','senior'):[0.78,0.89,0.89,0.86],
('Anderson','male','junior'):[0.8,0.73,0.78,0.8],
('Nilson','male','junior'):[0.82,0.84,0.79,0.76],
('Arnie','male','sophomore'):[0.68,0.73,0.81,0.72],
('Joch','male','junior'):[0.82,0.86,0.8,0.73],
('Jurg','male','junior'):[0.68,0.78,0.78,0.81],
('Carly','male','junior'):[0.72,0.82,0.79,0.76],
('Thorson','male','senior'):[0.91,0.84,0.9,0.89],
('Harrie','male','junior'):[0.76,0.78,0.8,0.79],
('Adi','male','senior'):[0.83,0.87,0.82,0.83],
('Var','male','senior'):[0.76,0.86,0.88,0.79],
('Shant','male','senior'):[0.79,0.81,0.78,0.78],
('Krishna','male','sophomore'):[0.66,0.76,0.74,0.8],
('Manojol','male','junior'):[0.75,0.77,0.72,0.81],
('Sophi','female','senior'):[0.83,0.96,0.9,0.95],
('Lynne','female','senior'):[0.97,0.85,0.93,0.88],
('Bailee','female','sophomore'):[0.83,0.78,0.74,0.75],
('Karenly','female','junior'):[0.79,0.88,0.9,0.84],
('Audree','female','junior'):[0.79,0.85,0.86,0.81],
('Suzy','female','junior'):[0.81,0.82,0.93,0.88],
('Maris','female','senior'):[1,0.92,0.95,0.91],
('Tanis','female','sophomore'):[0.75,0.77,0.76,0.81],
('Errein','female','senior'):[0.88,0.93,0.97,0.91],
('Chantel','female','junior'):[0.85,0.84,0.85,0.79],
('Laura','female','junior'):[0.82,0.84,0.94,0.88],
('Sophia','female','senior'):[0.93,0.96,0.94,0.87],
('Bianca','female','junior'):[0.83,0.79,0.93,0.9],
('Mia','female','junior'):[0.89,0.85,0.89,0.91],
('Monika','female','junior'):[0.89,0.82,0.9,0.91],
('Emma','female','senior'):[0.96,0.85,0.88,0.97],
('Margaurite','female','junior'):[0.88,0.86,0.85,0.79],
('Helga','female','senior'):[0.9,0.85,0.84,0.89],
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 images
- Write code that iterates through a dictionary represented by the variable my_dict and prints any values (not keys!) associated with keys beginning with the letter "k" (lowercase).arrow_forwardThis section has been set as optional by your instructor. OBJECTIVE: Write a program in Python that prints the middle value of a dictionary's values, using test_dict from the test_data.py module. NOTE: test_dict is created & imported from the module test_data.py into main.py Example 1: test dict = {'a':1,'b':9,'c':2,'d':5} prints 5 Example 2: test_dict = {'b':9,'d':5} prints 5 Hint: You may(or may not) find the following function useful: list.sort() which sorts the elements in a list. Note: the result is automatically stored in the original list, and return value from the function is None Туре list = [1, 2,3,2,1] After calling: list = [1,1,2,2,3] list.sort(), 339336.2266020 x3zgy7 LAB 13.11.1: Middlest Value (Structured Types) АCTIVITY 0/11 File is marked as read only Current file: test_data.py 1 #This module creates the test_dict to be used in main.py 2 #Reads input values from the user & places them into test_dict 3 dict_size = int(input()) #Stores the desired size of test_dict. 4…arrow_forwardgiven dictionaries, d1 and d2, create a new dictionary with the following property. For each entry(a,b) in d1, if a is not a key of d2 then add (a,b) to the new dictionary. For each entry (a,b) in d2, if a is not a key of d1 then add (a,b) to the new dictionary. For example, if d1 is {2:3, 8:19, 6:4, 5:12} and d2 is {2:5, 4:3, 3:9}, then the new dictionary should be {8:19, 6,4, 5:12, 4:3, 3:9}. using puthonarrow_forward
- Write a function called list_to_dict(lst) that takes a 2-D list of sales records of this form.[["customer1", "bread", 5], ["customer2", "bread", 4.5], ["customer1", "egg", 6.75]]Your function will store the sales information in a dictionary, where each {key:value} pair of the dictionary stores {a unique customer: [ a list of all products purchased by this customer, total cost of these products]}, and returns the dictionary. Sample run,sales = [ ["customer1", "bread", 5], ["customer2", "bread", 4.5], ["customer1", "egg", 6.75],["customer2", "milk", 4.35], ["customer3", "egg", 3.6], ["customer4", "bread", 4.5],["customer1", "milk", 4.35], ["customer2", "egg", 3.6], ["customer4", "milk", 4.35] ]>>> record = list_to_dict(sales)>>> display(record)customer1 : [['bread', 'egg', 'milk'], 16.1]customer2 : [['bread', 'milk', 'egg'], 12.45]customer3 : [['egg'], 3.6]customer4 : [['bread', 'milk'], 8.85]arrow_forwardWhich statement would you use to delete an existing key-value pair from a dictionary?arrow_forwardAs part of this assignment, the program that you will be writing will store current grades in a dictionary using course codes as keys and with values consisting of percent grades in lists. The main functions of this program are to print a student's gradebook, to drop the lowest grade in each course, print the student's gradebook again, drop the course with lowest average, and finally printing the student's gradebook again. This program requires a main function and a custom value-returning function. In the main function, code these basic steps in this sequence (intermediate steps may be missing): start with an empty dictionary that represents a gradebook and then use a while loop to allow the input of course codes from the keyboard. End the while loop when the user presses enter without entering data.within the while loop:for each course entered, use a list comprehension to generate five random integers in the range of 70 through 100. These random integers in a list represent the…arrow_forward
- Please answer the ques in python with showing the answers. Q: A car dictionary: a) Implement a dictionary car with the keys brand, model, and color. Give appropriate values for each key (you choose). b) Print each item in the dictionary (see example output) c) Add a key transmission to the dictionary with the value ‘automatic’. d) Print the value for the key transmission (use the get method). Output Example: subaru crosstrek sapphire blue automaticarrow_forwardDictionary vegetables_info contains key-value pairs that represent the grade received by each vegetable item in an inspection. Dictionary grade_scale contains key-value pairs that represent the meaning of each grade. String vegetables_name is read from input. Complete the following tasks: Use pop() to remove vegetables_name from vegetables_info and assign vegetables_num with the value returned. Any string that is not a key in vegetables_info has the default value 0. Assign patient_grade with the value associated with key vegetables_num in grade_scale. Any number that is not a key in grade_scale has default value 'not reported'.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education