Inspiration
I wanted to create a program that at least somewhat aligned with one of the sponsored tracks at KnightHacks, and CapitalOne's track seemed like I could create a program that fitted the criterion of a financial hack. Then, the brainstorming happened. Spanning all the way back to my personal finance class in high school, I managed to remember the avalanche and snowball method of repaying back debts from the two seconds I wasn't daydreaming. "This'll be easy to program," I thought, "I just have to make a formula for how the debt decreases as I pay for it and I'll be done in a jiffy." Very,_ very _ wrong. Making it even worse, I chose to do it in Python instead of what I'm used to (C) to get my feet wet. A _ bunch _ of Googling happened because of that decision.
What it does
If it worked how I thought it would've, it would've had a while loop that would keep subtracting the sum of card_min_pay_values and card_monthly_charge_values from monthly_budget and then subtract that from the debt with the highest card_interest_values. As each month passes (each time it loops), months would increase by 1 and total_debt would increase by the interest rates of each debt. This process would keep repeating while total_debt was greater than 0. When that condition is no longer met, the program spits out how long it takes to pay back the debts and a tip about creating a budget. It would also calculate how long it takes to be debt-free using the snowball method, but that was too ambitious for me.
How I built it
I created it in repl.it because it compiles and builds faster than VS Code on my space heater. I used a "parallel list" (which should've been a tuple, but you live and you learn) that would store the info of each card in each corresponding lists' position. E.g., the first card's interest rate would be stored in card_interest_values[0], its balance would be stored in card_balance_values[0], and so on. The lists were also sorted so that the highest interest rate would appear first. That's all I could do with my little experience in Python.
Challenges I ran into
The first challenge I ran into was not knowing how to sort the parallel lists from highest interest rate to lowest without scrambling the data of which information went with which card. I ended up Googling a bunch and opening a support ticket. Two mentors suggested I use pandas or sort_index. I ended up zipping the lists together and using another sort function, and their help guided me to be able to do solve it. I also couldn't figure out an algorithm for actually doing the calculating part which is a bummer. I think it is partly because I just don't know enough about Python yet to work with its assets. I also ran into many errors revolving around not being able to add str and float from the inputs. Also, after recording, I noticed it said Card #2 for both when it sorted them out, so, oops.
Accomplishments that I'm proud of
I learned a _ whole _ bunch more about Python from this project and the hackathon's workshops, and I learned that there are some things from C that transferred over to Python (or were at least similar) like typecasting and formatted printing. I am a little disappointed that I couldn't make a formula and set up a proper while condition, but it was definitely a really good experience being at KnightHacks. Really looking forward finishing this program and making an actual program that I'm really passionate about.
What I learned
I learned some basic Python concepts from the video tutorials I binged and the Google results I found while I was scrambling to get it to work somehow. I also learned Python doesn't really have arrays without a library, and has lists instead.
What's next for Avalanche Debt Calculator
I'm definitely going to keep thinking about the formula and asking more experience programmers for their advice. I'll also definitely finish it, and add the snowball method, too, as I wanted to in the beginning.
Log in or sign up for Devpost to join the conversation.