Program - Python (Problem is below code) 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.
Program - Python (Problem is below code)
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 now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images