M1) Freezer alarm
A cold store keeps frozen food at -18 °C. A sensor in each freezer sends a temperature reading in degrees Celsius every minute. When the sensor fails to measure, it sends None instead of a number. The function freezer_status must return:
"No reading"when the reading isNone;"Alarm"when the reading is above -15.0 °C;"OK"otherwise.
Listing 1 shows the implementation that a programmer submitted.
A technician runs each of the following checks on its own. Which check fails?
assert freezer_status(None) == "No reading"assert freezer_status(-18.0) == "OK"assert freezer_status(0.0) == "Alarm"assert freezer_status(-15.0) == "OK"