printing the correct value from a list

I'm trying to get my list to print the total amount of temperatures that lie within the normal range (38.3 and 39.2). When it prints it just says the total amount is 0.0 but from the temperatures shown below it should be 50% any help would be greatly appreciated!

temperatures = [38.4, 38.5, 39.3, 39.1, 38, 36.5]

total_temperatures = len(temperatures)

normal_temperatures = 0

for temp in range(total_temperatures):
    if temp >= 38.3 and temp <= 39.2:
        normal_temperatures = normal_temperatures + 1


percentage = normal_temperatures * 100 / total_temperatures
percentage = round(percentage, 1)

print('The percentage of temperatures that lie within the normal range is', percentage)

Solution 1:

Replace for temp in range(total_temperatures): with for temp in temperatures: You want to compare the temperature values, not the index in a range.

Solution 2:

this is the correct code:

temperatures = [38.4, 38.5, 39.3, 39.1, 38, 36.5]

total_temperatures = len(temperatures)

normal_temperatures = 0
for temp in temperatures:
    if temp >= 38.3 and temp <= 39.2:
        normal_temperatures = normal_temperatures +1
percentage = normal_temperatures * 100 / total_temperatures
percentage = round(percentage, 1)

print('The percentage of temperatures that lie within the normal range is', percentage)