I am trying to use a for loop to get an average for each week and for the month in python:
sum = 0
sumA = 0
sumB = 0
sumC = 0
sumD = 0
week1 = (35,38,30,34,27,40,39)
week2 = (35,38,30,34,27,40,39)
week3 = (35,38,30,34,27,40,39)
week4 = (35,38,30,34,27,40,39)
for x in (week1):
sum = sum + week1[x]
avg1 = (sum + week1[x]) / 7
for y in (week2):
sumA = sumA + week2[y]
avg2 = (sumA + week2[y]) / 7
for z in (week3):
sumB = sumB + week3[z]
avg3 = (sumB + week3[z]) / 7
for k in (week4):
sumC = sumC + week4[k]
avg4 = (sumC + week4[k]) / 7
sumD = sum + sumA + sumB + sumC
avg = (sum + sumA + sumB + sumC) / 28
that is it but its not correct. can i get some help please