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 00:40
Reading characters and strings from the keyboard: consider the following c++ program 1. #include 2. #include 3. using namespace std; 4. mystring1 5. 6. int main() 7. { 8. 9. string mystring1, mystring2; mychar1 10. 11. 12. char mychar1, mychar2; 13. 14. cout< < "enter a string: "; mychar2 15. 16. cin> > mystring1; // 17. cin.get(mychar1); 18. cin> > mychar2; 19. getline(cin,mystring2); mystring2 20. 21. 22. cout<
Answers: 1
question
Computers and Technology, 22.06.2019 10:20
Print "usernum1 is negative." if usernum1 is less than 0. end with newline. convert usernum2 to 0 if usernum2 is greater than 10. otherwise, print "usernum2 is less than or equal to 10.". end with newline
Answers: 3
question
Computers and Technology, 22.06.2019 15:00
Which of the following has not been attributed at least in part to social media a. drug addiction b. depression c. kidnapping d. murder
Answers: 2
question
Computers and Technology, 23.06.2019 04:00
Another name for addicting games.com
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
Questions on the website: 13722359