It’s no secret that I’m really into personal finance. In fact, I’ve got a whole site dedicated to mostly that in my lifestyle blog Burke Does. It’s no surprise then that as I use have been working on codes and exercises I have made them applicable to my life through personal finance.
This morning I wanted to explore the concept of debt snowflakes.
For those of you who are unfamiliar, there are primarily two ways in which people go about aggressive debt repayment. The first, popularized by Dave Ramsey, is known as the debt snowball. The debt snowball requires the subject to pay minimums on all his or her debt and put every extra penny towards the smallest one. When that one is paid off, you apply all the money freed up (the minimum payment plus the extra you were applying to it) to the next largest debt, thus making your debt repayment “snowball” in size. This strategy provides quick wins that are meant to help emotionally encourage you to keep going. In fact, this is the approach that I’ve been using in my own debt repayment.
The second is known as the debt avalanche. In this process, you pay off the debt with the highest interest rate first, regardless of size or payment amount. This strategy allows the subject to pay off the least amount of interest in the process.
Debt Snowflakes as a Function
Yet still, there’s a small group of people who recommend debt snowflakes. The idea here is pay a little extra anywhere you can and eventually it will add up.
Having a hard time explaining the concept of debt snowflakes to a friend of mine, I decided to pay a demo of it.
First, I defined the
def debt_snowflakes(min_pay, balance):
. payments = (balance/min_pay) + 2
. print("You have %d payments left if you just pay the minimum." % payments)
. payments = (balance/(min_pay + 100)) + 2
. print("If you pay an extra $100 per month, your payments will go down to %d." % payments)
Here I’ve decided that the snowflake amount is $100, but this could easily be changed by adding a variable called
extra that stores the snowflake payment amount.
A key note here: I’ve not factored in interest rate at all. While that would be valuable, I left it out for simplicity. As a result I added 2 extra payments to both cases. While not perfect, the goal here was not to tell people how many payments they have left, but instead demonstrate the effect that a snowflake payment will have on debt paydown.
I wanted to make this experience interactive for my visitor, so I decided to depend on the
raw_input command. Even though this would only make it interactive through the command line, it would be the first step towards interactivity. This way, too, I could test it out with different numbers and see what the effects were.
Before creating my
for loop, I started by defining key variables- er, rather allowing my user to.
debt_count = int(raw_input("How many debts do you have? \n> "))
debts = range(debt_count + 1)
drop = debts.pop(0)
Because python handles ranges different than the way a non-technical user might expect a list count to be, I’ve adjusted the user’s input. By adding one to the
debt_count value presented in
range, I can produce a number for all of the debts that the user has. By using the
drop variable, I remove the
0 without having it print to the command line.
for loop functions in three parts. Here it is in full:
for debt in debts:
. if debt == 1:
. print("We're going to focus on just debt number %d" % debt)
. print("Now we're going to focus on debt number %d" % debt)
. name = raw_input("Who is your loan provider? \n> ")
. min_pay = float(raw_input("What is your minimum payment? \n> "))
. balance = float(raw_input("What is your current balance? \n> "))
. debt_snowflakes(name, min_pay, balance)
Because I wanted the language to flow more easily between the first debt and subsequents debt, I included the
if/else statement, but it is unnecessarily and mostly vain. Otherwise, the loop simply asks the user for the information we need for his or her debts so that we can pass it into the
You can see the full code here.
I could work on building our the debt snowball and debt avalanche logics as well, making this calculator more useful for many purposes. Alternatively, I could try to deploy this, with its current functionality, as a flask app.
Frankly, I’m leaning towards the latter. I think deploying another app would be cool, something I haven’t done since I deployed my weather app a couple of weeks ago. Then I’ll be able to build additionally functionality into the app over time!