A family runs a small farm with cattle, poultry, fish and bees. You will find the profit of each part. Then you will find the part that earns the most and the profit of the whole farm.
The idea. For each part of the farm you know the income and the cost for a year, in rupees. The profit is the income minus the cost.
Your tasks.
profit, return the profit for an income and a cost.profits to a dictionary of the profit of each part of the farm.best to the name of the part with the greatest profit.total to the profit of the whole farm.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…