Nov-19-2018, 02:31 PM
first you create a list of temperatures:
next the following code (lines 15 - 17):
and calculate % on result
temperatures = [20,15,17,16,14,19,18,19] for n in range(1, 9): temperatures.append(int(input(f'Enter temp {n}: ')))and then the next thing you do is overwrite the list (line 12):
temperatures = [20,15,17,16,14,19,18,19]so now everything that you entered is gone!
next the following code (lines 15 - 17):
total = 0 for temperatures in temperatures: total = total + temperaturescan be shortened to:
total = sum(temperatures)and lines (20 - 22) can be shortened to:
length = len(temperature)now you need to write code to pull all items above 16
and calculate % on result