As an exercise, I want to translate the algorithm for this question into code:

Question:
A bank account starts out with £10000. Interest is compounded monthly at 0.5 per cent per month. Every month £500 is withdrawn to meet college expenses. After how many years is the account depleted.

Algorithm:
balance = 10000
months = 0
while balance is > 0
Add 0.5 percent interest
Reduce the balance by £500
Increase the number of months by 1
Compute the number of years as months divided by 12
Report the number of years.

The code is:

balance = 10000
months = 0
interest = 0
while balance > 0 :
interest = balance * 0.005
balance += interest
balance -= 500
print("Month: " + months + "Balance: " + balance)
months += 1
years = months // 12
print ("The account will be depleted in: " + years )

But it’s not doing what I want…so would appreciate your comments.

Nothing is being concatenated in that example. You’re passing print two separate arguments: "The account will be depleted in" and +4 (if years = 4). In this case Python is interpreting the + sign as positive 4 (as opposed to -4) and casting the int to a string.