Two dictionaries give the water that a person gains and loses in a day, in litres. You will add them up, work out the urine that keeps the balance, and say whether the water is short.
The idea. The body water stays the same when the gains equal the losses. The kidneys cannot pass less than about 0.5 L of urine a day.
Your tasks.
total. It adds the values of a dictionary.urine_needed. It gives the litres of urine that make the losses equal to the gains.short_of_water. It gives True when the urine that is needed is less than 0.5 L.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…