Public feed
#721243
Question:
Given a variable temps that refers to a list, all of whose elements refer to values of type float , representing temperature data, compute the average temperature and assign it to a variable named avg_temp . Besides temps and avg_temp , you may use two other variables -- k and total .
My Attempt:
for k in temps:
total += temps[k]
avg_temp = total / len(temps)