21 September 2026
Calm Battery Readings
Easy
Lists
Numbers
Count the battery readings that stay strictly inside a safe band.
A workshop records battery readings during a test. You are given the readings, a low warning level, and a high warning level. Count each reading that is greater than the low warning level and less than the high warning level. Return the count. Readings equal to either warning level do not count. If there are no readings, return 0.
Constraints
readings contains between 0 and 500 whole numbers.low is less than high.Every reading, low, and high is between -100000 and 100000.
Function signature
def count_calm_readings(readings, low, high):