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 othervariables -- k and total .
My solution below didn't work. I wonder how to go about this problem.
temps = []
avg_temp = 0.0
total = 0.0
for k in range(temps):
total += k
avg_temp = total/len(temps)