A living thing has a fixed level of carbon-14. After death, half of it is gone every 5730 years. You will write three small functions that turn an age into a fraction and a fraction into an age.
The idea. After half-lives, a fraction of the carbon-14 is left. So the number of half-lives is .
Your tasks.
fraction_left. It gives the fraction of the carbon-14 that is left after age years.half_lives. It gives the number of half-lives that have passed when fraction is left.age_of. It gives the age in years of a sample with fraction left.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…