def main():
student_dictionary=\
{
'Brian': [94, 89, 92],
'Rachel': [100,90,65],
'Jon': [67.5,95,100],
'Brit': [0,78,80] ,
'Gret': [65,100,78],
'Andrea': [55.5,67,79]
}
for key, values in student_dictionary.items():
print('Name: ', key, " , Marks:", values)
if __name__ == '__main__':
main()
Problem:
Make a new dictionary. Using the dictionary I made from above,. the new dictionary should consist of the key is the name of the person, and the value is just the average of their scores. So it’s six key value pairs but instead of the value being a list like the first problems, this time it's just their average (which you compute from their scores in the other dictionary. Print the new dictionary out.
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 images
- C programmingarrow_forwardWhat is a pointer? How do you dereference a pointer to get its stored value?arrow_forwardProgram - Python Problem below the code This is my code for a dictionary of student's test scores. def main():#Create a dictionary with name as key#Marks as the list of valuesstudent_dictionary=\{'Brian': [94, 89, 92],'Rachel': [100,90,65],'Jon': [67.5,95,100],'Brit': [0,78,80] ,'Gret': [65,100,78],'Andrea': [55.5,67,79]}#Loop that print name and list of marksfor key, values in student_dictionary.items():print('Name: ', key, " , Marks:", values)#Call main functionif __name__ == '__main__':main() Problem: print the dictionary data using a loop that starts with for key inarrow_forward
- Alert: Don't submit AI generated answer and please submit a step by step solution and detail explanation for each steps. Write a python program using functionsarrow_forwardPlease complete the following guidelines and hints. Using C language. Please use this template: #include <stdio.h>#define MAX 100struct cg { // structure to hold x and y coordinates and massfloat x, y, mass;}masses[MAX];int readin(void){/* Write this function to read in the datainto the array massesnote that this function should return the number ofmasses read in from the file */}void computecg(int n_masses){/* Write this function to compute the C of Gand print the result */}int main(void){int number;if((number = readin()) > 0)computecg(number);return 0;}Testing your workTypical Input from keyboard:40 0 10 1 11 0 11 1 1Typical Output to screen:CoG coordinates are: x = 0.50 y = 0.50arrow_forwardIn Python, grades_dict = {'Wally': [87,96,70], 'Eva': [100,87,90], 'Sam': [94,77,90], 'Katie': [100,81,82], 'Bob': [83, 65, 85]} write your own describe function that produces thesame 8 statistical results, for each one of the columns, that the built-in describe() function does.Note 1: Use the sample standard deviation formula (that is, the denominator is: N-1)Note 2: Your algorithm should work for any number of columns not just for 5Note 3: You can use the np.percentile() for the 25% and 75% percentile as well as the sort()built-in functionsarrow_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