You will write three small functions that use the Mohs scale of hardness.
The idea. A mineral scratches every mineral that is softer than itself. The dictionary mohs holds the ten minerals of the scale, and tools holds four everyday tools.
Your tasks.
scratches, return True if mineral a can scratch mineral b, and False if it cannot.hardest, return the name of the hardest mineral in the list names.tools_for, return a list of the tools that can scratch the mineral name, in the order of the dictionary.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…