开始使用免费开始使用

计算应付账款(供应商)

现在来看一种情形:这次是我们获得了赊购额度。也就是说,我们可以先购买,之后再付款。

在本练习中,T-Z 需要购买螺母和螺栓,以便在 1 月生产 1000 个单位、在 2 月生产 1200 个单位。每个单位所需的螺母和螺栓成本为 0.25 USD。信用条款为 50% 现金预付,50% 于 30 天后支付。

因此,本例中的应付账款(creditors)会在紧随其后的下一个月支付。这意味着,应付账款的数值只反映当月的赊购部分。

本练习是课程的一部分

Python 金融预测

查看课程

练习说明

  • 设定每单位成本。

  • 创建生产列表 production,包含 1 月和 2 月的单位数量,并创建空的 creditors 列表。

  • 计算 1 月和 2 月的应付账款 creditors

    • 为此,对 production 中每个单位数量(mvalue)使用 .append() 方法,将其乘以单位成本和信用条款(0.5)。
  • 打印 1 月和 2 月的 creditors 余额。

交互式实操练习

通过完成这段示例代码来试试这个练习。

# Set the cost per unit
unit_cost = ____

# Create the list for production units and empty list for creditors
production = [____,____]
creditors = ____

# Calculate the accounts payable for January and February
for mvalue in ____: 
    creditors.____(mvalue * ____ * 0.5)
    
# Print the creditors balance for January and February
print("The creditors balance for January and February are {} and {} USD.".format(____[0], ____[1]))
编辑并运行代码