You will write three small functions: the period of a building, the period of a soil layer, and a test that tells whether a building is in danger.
The idea. A building has a period of for each storey. A soil layer of thickness with shear waves of speed has a period . A building is in danger when its period is within of the soil period.
Your tasks.
building_period, return the period in seconds of a building with storeys storeys.soil_period, return the period in seconds of a layer h metres thick with shear waves of speed vs in .in_danger, return True when the building period is within of the soil period ts, and False if not.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…