In order to make burger a chef needs at least the following ingredients: • 1 piece of chicken meat • 3 lettuce leaves • 6 tomato slices Write down a formula to figure out how many burgers can be made. Get values of chicken meat, lettuce leaves and tomato slices from user. Hint: use Python’s built-in function
4/13/2021 8:43:39 AM
Rosy9 Answers
New AnswerInput the number of pieces of each ingredient. Divide each entered ingredient by required number of that ingredient. The lowest value will be the number of burgers that can be made. https://code.sololearn.com/cBZvI9DgK5yW/?ref=app
a = list(map(int,input().split(", "))) print(min(a[0], a[1]//3, a[2]//6)) # Hope this helps
Calvin Thomas , that might work, but it's not very pythonic. See if you can write in such a way that someone reading it knows exactly what it's doing, even if they don't understand the way that the built-ins work.
Myk Dowling I usually aim to make my codes small, often forgetting about their complexity. I'll take care about that next time.
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message