subject

Prompt: You work for an electronic manufacturer, and have been asked to calculate the total profit made on the sales of a product. You are given a dictionary containing the cost price per unit (in dollars), sell price per unit (in dollars), and the starting inventory. Create a function that takes in a dictionary and returns the total profit made, rounded to the nearest dollar. In your program make sure you include:
Clearly defined function with accurate parameter
Return statement
Output of total profit made rounded to the nearest dollar

Notes:
Assume all inventory has been sold.
Profit = Total sales - Total cost
Might need to use a method, try some of these
You might need to loop through both the key and the values
for key, value in dictionary_name. items():
https://www. w3schools. com/python/python_ref_dictionary. asp

Starting code:

def profit():
return 0

headphones ={"cost_price": 20.54, "sell_price": 45.00, "inventory": 100}
chargers ={"cost_price": 6.78, "sell_price": 12.00, "inventory": 1200}
usb_cable = {"cost_price": 2.58, "sell_price": 10.00, "inventory": 500}

pls dont scam me

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:50
The file sales data.xlsx contains monthly sales amounts for 40 sales regions. write a sub that uses a for loop to color the interior of every other row (rows 3, 5, etc.) gray. color only the data area, columns a to m. (check the file colors in excel.xlsm to find a nice color of gray.)
Answers: 2
question
Computers and Technology, 23.06.2019 01:50
Write a program that uses a random number generator to generate a two digit positive integer and allows the user to perform one or more of the following operations: a. double the number. b. reverse the digits of the number. c. raise the number to the power of 2, 3, or 4. d. sum the digits of the number. e. if the number is a two-digit number, then raise the first digit to the power of the second digit. f. if the number is a three-digit number and the last digit is less than or equal to 4, then raise the first two digits to the power of the last digit. after performing an operation if the number is less than 10, add 10 to the number. also, after each operation determine if the number is prime. each successive operation should be performed on the number generated by the last operation. your program should not contain any global variables and each of these operations must be implemented by a separate function. also, your program should be menu driven. 7. (fraction calculator) write a program that
Answers: 1
question
Computers and Technology, 24.06.2019 08:30
@josethesolis i need can anyone text me and follow me
Answers: 1
question
Computers and Technology, 24.06.2019 10:00
1. which of these is not true about torsion bars? a. they can be used to adjust ride height b. they can be adjusted anytime since they don't affect alignment angles c. they attach between the frame and the lower control arm d. they twist to produce a spring effect
Answers: 1
You know the right answer?
Prompt: You work for an electronic manufacturer, and have been asked to calculate the total profit m...
Questions
question
Mathematics, 21.05.2021 01:20
question
Mathematics, 21.05.2021 01:20
question
Mathematics, 21.05.2021 01:20