Create a dictionary that stores the names of three students as keys and their grades as values. Then, write a function that takes this dictionary as an argument and returns the average grade of the students.
Here is a starting point:
# Example starting point:
students_grades = {
"Alice": 85,
"Bob": 78,
"Charlie": 92
}
Click below to code your solution on your browser now:
Use the button below to see our solution:
def avg_grade(x):
n=0
e=0
for i in x.values():
e+=i
n+=1
return e/n
students_grades = {
"Alice": 85,
"Bob": 78,
"Charlie": 92
}
result=avg_grade(students_grades)
print (result)