You will program a heater that uses two stored values, and count how often it switches on.
Your tasks.
next_state, return the new state of the heater (True for on). It switches on when the reading is below low, and off when the reading is above high. Otherwise it keeps its state.readings in order, starting with the heater off. Add the state after each reading to states.switch_ons how many times the heater changes from off to on.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…