Learn to code with step-by-step lessons. A place for students to work through programming fundamentals and build skills.
One possible program:
goal = float(input("Savings goal ($): "))
balance = 0.0
weeks = 0
while balance < goal:
weekly_savings = float(input("Saved this week ($): "))
balance += weekly_savings
weeks += 1
print("Goal reached in", weeks, "weeks. Balance:", balance)