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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 08:00, Leggett8152
What best describes a career pathway in a lodging career? a worker starts out as an amusement attendant, then becomes a recreation worker, and then becomes a gaming worker within five years. a worker starts out as a bell hop, then becomes a night clerk, and then becomes a hotel manager within five years. a worker starting out as a tour guide, then becomes a travel clerk, and then becomes a travel agent within five years. a worker starts out as a server, then becomes a food preparer, and then becomes a head chef within five years.
Answers: 1
image
Computers and Technology, 23.06.2019 03:00, jarteria0
State 7 common key's for every keyboard
Answers: 1
image
Computers and Technology, 23.06.2019 09:30, gabby640
Name the range function that would generate the following list of integers values: 0,1,2,3,4,5.
Answers: 1
image
Computers and Technology, 23.06.2019 10:00, thezbell
What is estimated time of arrival (eta)? a device that measures the acceleration (the rate of change of velocity) of an item and is used to track truck speeds or taxi cab speeds a gps technology adventure game that posts the longitude and latitude location for an item on the internet for users to find a north/south measurement of position the time of day of an expected arrival at a certain destination and is typically used for navigation applications
Answers: 3
You know the right answer?
Prompt: You work for an electronic manufacturer, and have been asked to calculate the total profit m...

Questions in other subjects:

Konu
Mathematics, 09.01.2020 15:31