Unit 2 Task 34 - Solution

Learn to code with step-by-step lessons. A place for students to work through programming fundamentals and build skills.

Solution - Task 34: Simple pay-down balance

← Back to task


One possible program:

balance = float(input("Balance owed ($): "))
payment = float(input("Monthly payment ($): "))
months = 0

while balance > 0:
    balance -= payment
    months += 1

print("Paid off in", months, "months.")