marks={'A':[50,70,90],'B':[60,80,70],'C':[70,80,90]}
In the above dictionary, I need to access the value of B and to find the average of list (i:e:(60+80+70)/3). How could I access the value and find the average? What I tried was...
marks={'A':[50,70,90],'B':[60,80,70],'C':[70,80,90]}
get_name=input()
for i in marks:
if i==get_name:
for j in i:
add += marks[j]
print(add/3)
It shows up error. How to access the values in the dictionary of the list[60,80,70] with respect to key 'B'.