LoslegenKostenlos loslegen

Calculating gross profit

Gross profit is the amount of money you generated in sales minus the cost of selling those goods (Also know as Cost of Goods Sold or COGS). COGS does not include administration or marketing costs, only costs directly related to production or providing the good or service, so Gross Profit is a good metric to see the core profitability of any product\service.

\(Gross\,Profit = {Total\,SalesValue}-{Total\,COGS}\)

Gross profit margin is the gross profit expressed as a percentage of sales, which is valuable for analysis and decision making.

\(Gross\,Profit\,Margin = \frac{Gross\,Profit}{SalesValue}\)

As the manager of a factory, you have been asked to check the gross profit forecast for the following year.

Diese Übung ist Teil des Kurses

Financial Forecasting in Python

Kurs anzeigen

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Set the sales variable to 8000
sales = ____

# Set the cost of goods sold (cogs) variable to 5400
cogs = ____

# Calculate the gross profit (gross_profit)
____ = ____ - ____

# Print the gross profit
print("The gross profit is {}.".format(____))
Code bearbeiten und ausführen