Very new to python. I am trying to iterate over a list of floating points and append elements to a new list based on a condition. Everytime I populate the list I get double the output, for example a list with three floating points gives me an output of six elements in the new list.
tempretures = [39.3, 38.2, 38.1]
new_list = []
i=0
while i <len(tempretures):
for tempreture in range(len(tempretures)):
if tempreture < 38.3:
new_list = new_list + ['L']
elif tempreture > 39.2:
new_list = new_list + ['H']
else: tempreture (38.3>=39.2)
new_list = new_list + ['N']
i=i+1
print (new_list)
print (i)
['L', 'N', 'L', 'N', 'L', 'N']
3
while i <len(tempretures):?