You will write three functions that compare greenhouse gases by their global warming potential (GWP over 100 years, AR5 values).
The idea. The carbon dioxide equivalent of a gas is its mass times its GWP. A list of emissions is the sum of these.
Your tasks.
equivalent(gas, kg). It returns the carbon dioxide equivalent in kg, using the dictionary GWP.total(emissions). It takes a dictionary of gas and mass and returns the total equivalent.biggest(emissions). It returns the name of the gas with the largest equivalent.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…