Question: Python problem. PRACTICE EXERCISES 3. Write a function chocolate bag that takes 3 integers as input. The first input indicated the number of small (1
PRACTICE EXERCISES 3. Write a function chocolate bag that takes 3 integers as input. The first input indicated the number of small (1 kg) chocolate bars you have, the second the number of big (5 kg) chocolate bars you have, and the third the number of kg of chocolate you want in your bag. The function returns the number of small bars to use to fill the bag, assuming we always use big bars before small bars. It returns - 1 if it can't be done. Example: chocolate bag (4, 1, 9) returns 4 chocolate_bag (4, 1, 10) returns - 1 chocolate_bag (4, 2, 7) returns 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
