應付帳款(債權人)計算
現在換成我們獲得信用條件的情境。也就是說,你可以先購買,之後再付款。
在本練習中,T-Z 需要在 1 月生產 1000 單位、2 月生產 1200 單位的產品,並購買螺帽與螺栓。每單位的螺帽與螺栓成本為 0.25 美元。信用條件為 50% 現金預付、50% 於 30 天後支付。
因此,在此情況下,債權人金額會在下一個月支付。也就是說,債權人金額只會反映當月的信用採購。
本練習屬於課程
使用 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]))