計算銷售額
要做銷售預測,你需要同時知道預計的銷售單價,以及預期能賣出的單位數。在這個例子中,我們來看一間生產並銷售 T 恤的公司 T-Z。
這家公司提供兩種選擇:基本款與客製款。基本款 T 恤每件 15 美元,客製款每件 25 美元。
T-Z 已經預測下個月的 T 恤訂單,並打算維持相同的銷售組合:基本款佔 60%,客製款佔 40%。由於這個組合相對穩定,我們可以替 T-Z 計算每件商品的平均銷售單價。變數 forecast_units 已為你設定好。
本練習屬於課程
使用 Python 進行財務預測
練習說明
- 將基本款的銷售單價設定為變數
salesprice_basic,將客製款的單價設定為變數salesprice_custom。 - 依據銷售組合,計算 T 恤的平均銷售單價。
- 計算下個月的預測銷售金額
sales_USD。 - 印出總銷售額(美元)。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Set variables units sold and sales price of the T-shirts (basic and custom)
____ = ____
salesprice_custom = ____
# Calculate the combined sales price taking into account the sales mix
average_sales_price = (____ * 0.6) + (____ * ____)
# Calculate the total sales for next month
sales_USD = ____ * ____
# Print the total sales
print("Next month's forecast sales figure is {:.2f} USD.".format(____))