Sizes in nature run from a proton to the visible universe. You will make the program find the order of magnitude of each size, sort the sizes, and count how many powers of ten lie between the smallest and the largest.
The idea. Write a number as with . The order of magnitude is if , and if .
Your tasks.
order(x) return the power of ten of the order of magnitude.smallest_first the names, sorted from the smallest size to the largest.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…