A dairy keeps four cows. You will write a function for the milk in one lactation. Then you will find the milk of each cow and the cow that gives the most. Last, you will work out the income from the whole herd.
The idea. Each cow has a milk yield in litres a day and a lactation period in days. The milk in one lactation is the yield times the days. The dairy sells the milk at price rupees for each litre.
Your tasks.
lactation_total, return the litres of milk for a yield and a number of days.totals to a dictionary of the litres for each cow.best to the name of the cow that gives the most milk.income to the money from the milk of the whole herd.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…