0

Goods & Construction

Create a function named whatToBuy that receives four arguments: -First argument is a list of numbers that indicate the price of a construction item -Second argument is a list of numbers that indicates the quantity of each construction item -Third argument is a number indicating the total price allowed for each item -Fourth argument is a list of construction names. The function calculates, for each item, the total price required to buy it. The total price for each item is calculated like this: (quantity * price) / (average_quantity * average_price) The function will return a list of two elements: The first element is a sorted list of all the construction names whose total price is smaller than the restriction (third argument). The second element is a number, which indicates how many construction items removed.

10th Jul 2025, 2:25 PM
MANASWI VISHAL SORDE
MANASWI VISHAL SORDE - avatar
3 Respuestas
+ 6
Is this your homework or a challenge?
10th Jul 2025, 2:44 PM
Lisa
Lisa - avatar
+ 1
What have you tried? Show your code.
11th Jul 2025, 7:04 AM
Lisa
Lisa - avatar
0
A homework question from uni
11th Jul 2025, 3:52 AM
MANASWI VISHAL SORDE
MANASWI VISHAL SORDE - avatar