You will write three small functions that compare earthquakes.
The idea. For each whole step of magnitude, the shaking is 10 times bigger and the energy is about 32 times bigger.
Your tasks.
shaking_ratio, return how many times more shaking the earthquake of magnitude big gives than the one of magnitude small.energy_ratio, return how many times more energy it sets free, with 32 times for each step.biggest, return the name of the earthquake with the largest magnitude from a dictionary of names and magnitudes.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…