You will write three small functions for the halogens. One decides the state of a halogen at room temperature from its melting and boiling points. One finds the average step in a list of values. One predicts the next value down the group.
The idea. A substance is a solid if room temperature is below its melting point. It is a liquid if room temperature is above the melting point but below the boiling point. Otherwise it is a gas. A trend can be continued: the next value is the last value plus the average step.
Your tasks.
state_at_room(melting, boiling). Room temperature is room, which is .average_step(values). It returns the average of the differences between neighbouring values.predict_next(values). It returns the last value plus the average step.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…