Sei sulla pagina 1di 1

20.

WAP in python to input a nested dictionary and display records of people having average
greater than 30.

d={}

for i in range(5):

nm=input("enter name")

m1=int(input("enter marks of maths"))

m2=int(input("enter science marks"))

d[nm]={"maths":m1,"science":m2}

for i in d:

s=(d[i]["maths"]+d[i]["science"])/2

if s>30:

print(i)

Potrebbero piacerti anche