开始使用免费开始使用

在折扣条件下预测销售额

销售常常伴随捆绑与折扣。折扣既是重要的营销工具,也是清库存的方式。 我们再次来看 T-Z 公司。

T-Z 推出了一款与某位名人梗相关的新款 T 恤,每件售价 40 USD。 他们的货架上有过量的 Celebshirt1 库存,并预计 Celebshirt2 将在 2 月发布,因此宣布在 2 月对 Celebshirt1 提供 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(____, ____))
编辑并运行代码