Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
List Code
#1
Dear all, I am lerning Python and would like to know if it is possible to implement the following:

Lets suppose I'm a fruit distribuitor and I have in my stock: 3 bananas, 3 apples, 3 oranges.

And I have 3 markets with the current stock:

Market A: 1 orange / 2 apples / 3 banana
Market B: 2 oranges / 5 apples / 1 banana
Market C: 5 oranges / 1 apple / 2 banana

How would I program that python retrieve me the best market to fit each fruit and the ideal volume of it... based on the current stock and my distribuitor volume?

The answer for this would be:

Market A: receive: 2 oranges / 1 apple / 0 banana
Market B: receive: 1 oranges / 0 apple / 2 banana
Market C: receive: 0 oranges / 2 apple / 1 banana

However lts suppose that I have thousands of markets and many other thousands of fruits... Is this really possible?

Appreciate all support!!!

Greetings! Big Grin Big Grin
Reply
#2
Looks like a homework assignment.

Please show what you have tried so far.
We are glad to help, but expect you to make a good effort as well.
If you've already written some code, show what you've got, and where there is an issue.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020