CommencerCommencer gratuitement

Calculating accounts receivable (debtors)

When we sell something on credit, the credit portion is in the balance sheet under ‘Accounts Receivable’ or ‘Debtors’. For example, if credit sales are made in January with a 60-day payback period, they would be recorded in our ‘Debtors’ account in January, but only be paid (released) in March, and so on.

In this exercise, we will create the following lists:

  • The credit sales in the month credits, which in this exercise is 60% of the sale value.
  • The total accounts receivable debtors, to be calculated as the credits for the current month, plus the credits of the month before, minus the credits of two months before (as we assume the credits from 2 months ago or 60 days, will be repaid by then).

We have set an index for the variable month. The month value is set at 0.

Cet exercice fait partie du cours

Financial Forecasting in Python

Afficher le cours

Instructions

  • Create a blank credits list and blank debtors list.

  • Complete the for loop:

    • Calculate the credit of the month by multiplying the sales value (set to variable mvalue) by the percentage credit (60%).
    • If the month is greater than 0, append the debtors as current month credits plus credits of prior month.
    • If the month is not greater than 0, append the debtors as the current month credits.
  • Print the debtors list.

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Create the list for sales, and empty lists for debtors and credits
sales = [500, 350, 700]
____ = [] 
____ = []

# Create the statement to append the calculated figures to the debtors and credits lists
for mvalue in sales: 
    credits.append(mvalue * ____)
    if month > 0:
        ____.append(credits[____] + credits[month-1])
    else:
        ____.append(credits[____]) 
    month += 1
# Print the result
print("The ‘Debtors’ are {}.".format(_____))
Modifier et exécuter le code