Hi I'm fairly new to Python, been doing some work with lists, but have got stuck. Hoping someone maybe can help.
I need to take an input list of numbers. Than print the numbers that are not in the range of 0 to 5. So any numbers that are not 0,1,2,3,4,5 will be printed as my output.
Here is what I've trailed so far, with no luck.
I need to take an input list of numbers. Than print the numbers that are not in the range of 0 to 5. So any numbers that are not 0,1,2,3,4,5 will be printed as my output.
Here is what I've trailed so far, with no luck.
temperatures = [12, 4.5, -1, -3.4, 5, 6, 2] wrong_temps = [] a = 0 b = 5 for i in temperature: if i < a or i > b: wrong_temps.append(i) print(wrong_temps)