You will write three small functions about resources and energy.
The idea. Years left = store ÷ use each year. Energy in kWh = power in kW × hours. The dictionary factors gives the kg of carbon dioxide for each kWh of each kind of electricity.
Your tasks.
years_left, return how many years a store lasts, from the store and the use each year.energy, return the kWh used by a machine of power kW that runs for hours hours.co2_saved, return the kg of carbon dioxide saved when kwh kWh come from the source new instead of the source old.Run your code once to unlock the worked solution.
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…