You will model the workshop of the first lesson in code and search all the whole-number plans for the best one. The checker tests your functions on many plans.
The idea. A plan is a pair of tables and chairs. Cutting takes hours, which must be at most . Finishing takes hours, which must be at most . The profit is pounds.
Your tasks.
profit(x, y). Return the profit in pounds.is_allowed(x, y). Return True if , , and both hour limits are kept.best_plan(). Try every whole number and from 0 to 20, and return (best profit, x, y).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…