A set of food test results is read by a program. You will turn the colours into a decision, find which nutrients a food contains, and calculate the vitamin C in a juice.
The idea. Each test has one positive colour. A food contains the nutrient if the colour seen is the positive colour. For DCPIP, of vitamin C decolourises .
Your tasks.
result. It gives "positive" if the colour seen is the positive colour of the test, and "negative" if not.contents. It takes a dictionary of the test names and the colours seen, and gives the list of nutrients that are present, in the order of the dictionary.vitamin_c. It gives the mg of vitamin C in each cm3 of juice, from the juice volume and the DCPIP volume, both in cm3.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…