Python's round(x, n) rounds to a number of decimal places. A chemist often needs a number of significant figures instead. You will write a function for it, and use the rules for products and sums.
The idea. The first significant digit of is at the place : for units, for hundreds, for thousandths. To keep figures, round to decimal places.
Your tasks.
round_sf(x, n).area to the area of a by card, with the right number of significant figures.total to , with the right number of decimal places.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…