開始使用免費開始

套用折扣的銷售預測

銷售常會搭配組合與折扣。折扣是很好的行銷工具,也能幫助消化庫存。 再來看一次 T-Z 公司。

T-Z 推出一款與名人梗相關的新 T 恤系列,每件售價 40 USD。 他們手上還有很多 Celebshirt1 的庫存,並預期 Celebshirt2 將於 2 月上市,因此宣布 Celebshirt1 在 2 月享有 40% 折扣。

在本練習中,價格以 USD 表示,單位數為各月份的總銷售件數。以下變數已為你定義:

sales_price = 40

units_january = 500

units_february = 700

1 月的銷售只包含 Celebshirt1

2 月的銷售包含 Celebshirt1Celebshirt2,比例為 45:55。

本練習屬於課程

使用 Python 進行財務預測

檢視課程

練習說明

  • 預測 1 月的銷售額(無折扣)。
  • 預測 2 月的銷售額(套用折扣:dsales_price)。
  • 印出 1 月與 2 月的銷售額結果。

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

# Forecast the sales of January
sales_january = ____ * ____

# Forecast the discounted price
dsales_price = ____ * 0.6

# Forecast the sales of February
sales_february = (____ * units_february * 0.55) + (dsales_price * ____ * ____)

# Print the forecast sales for January and February
print("The forecast sales for January and February are {} and {} USD respectively.".format(____, ____))
編輯並執行程式碼