Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Python problem.
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Issues In Database Management A Refernce For The Thinking Practitioner

Authors: Fabian Pascal

1st Edition

0201485559, 978-0201485554

More Books

Students also viewed these Databases questions

Question

What are some of the reasons why diversity education programs fail?

Answered: 1 week ago

Question

5. Describe the visual representations, or models, of communication

Answered: 1 week ago