計算毛利
毛利是你從銷售中產生的金額,減去銷售該商品的成本(也稱為銷貨成本,COGS)。COGS 不包含管理或行銷費用,只包含與生產或提供商品/服務直接相關的成本,因此毛利可以很好地反映任何產品/服務的核心獲利能力。
\(Gross\,Profit = {Total\,SalesValue}-{Total\,COGS}\)
毛利率是以銷售額為分母的毛利百分比,對分析與決策很有幫助。
\(Gross\,Profit\,Margin = \frac{Gross\,Profit}{SalesValue}\)
身為工廠經理,你被要求檢查下一年度的毛利預測。
本練習屬於課程
使用 Python 進行財務預測
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# 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(____))