Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CIon Z1.3 (Filter). A fridge should keep food at a temperature between 0 and 5 degrees Celsius (inclusive). Assume you have a non-empty list of

image text in transcribed
image text in transcribed
CIon Z1.3 (Filter). A fridge should keep food at a temperature between 0 and 5 degrees Celsius (inclusive). Assume you have a non-empty list of integer and/or floating-point numbers representing the hourly temperature readings, also in degrees Celsius. Print the list of all temperatures that are outside the allowed range. The answer box contains Pattern 2.3 (List filtering) as comments, to get you started. Write the corresponding code beneath each comment. Use variable names appropriate to the problem at hand instead of the generic names used by the pattern. The first step has been done for you. It uses an operation we defined for you, get_input(), to obtain the list used by each test. The list from get_input () is assigned to temperatures (which corresponds with the input_list in the pattern). You do not have to understand or work out how get Input Result [4.7] [] [5.2] [5.2] [0, 3, 5, 7, 5, 4, 2, 0, -0.2] [7, -0.2] Answer: (penalty regime: 0 %) Reset answer # initialise the input_list with the given values 2 tenperatures = get_input() # initialise the output_list to the empty list 4|| 5- # for each input_value of the input list: 3 # if the input_value satisfies the condition: # append the input_value to the output list # print the output_list 8

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 31st International Conference Dexa 2020 Bratislava Slovakia September 14 17 2020 Proceedings Part 1 Lncs 12391

Authors: Sven Hartmann ,Josef Kung ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

303059002X, 978-3030590024

More Books

Students also viewed these Databases questions

Question

2. What is the impact of information systems on organizations?

Answered: 1 week ago

Question

Evaluate the impact of technology on HR employee services.

Answered: 1 week ago