I have a dictionary of length 50 which has numbers(from 0 to 50) as keys and BMI(float from 0.1 to 0.98) as the values.The code that i have tried only extract first and 5th value from the keys..but i need to extract every first and 5th value.
I need to create a new dict such that the output has
key:(0,5), value: average of bmi(first 5 bmi)
key:(6,10), value: average of bmi(next 5 bmi) and so on
key_new=[]
val_new=[]
num=[0,5]
for i in num:
if(i==0):
number=list(dictionary.keys())[i]
key_new.append(number)
elif(i==5):
number=list(dictionary.keys())[i]
key_new.append(number)
print(key_new)