Build a Simple Budget Tracker Using Python Variables 

Build a Simple Budget Tracker Using Python Variables 

You’ve just learned about Python variables and data types — awesome!

Now it’s time to put those new skills into action. But don’t worry, we’re not jumping into anything complex like inputs or loops just yet. This tutorial is perfect if you’ve only covered:

  • ✅ Variables
  • ✅ Strings, Integers, Floats, Booleans
  • ✅ Arithmetic operations (+, -, etc.)
  • ✅ The print() function

We’re going to use only these to build your first real-world project: a simple budget tracker.


Why Build a Budget Tracker?

Budgeting is something we all do in real life — whether mentally, on paper, or using apps. It helps us track how much we earn and how much we spend.

What better way to practice Python than by building something relatable and useful?

This project will teach you how to:

  • Store and organize information with variables
  • Perform basic calculations
  • Print meaningful output

What Our Budget Tracker Will Do

Imagine this scenario:

You earn ₦150,000 monthly.

You plan to spend:

  • ₦50,000 on rent
  • ₦20,000 on food
  • ₦15,000 on transport
  • ₦30,000 into savings

You want your program to calculate how much you’ll have left at the end of the month.

That’s it — no user input, just hardcoded values using variables.

Step-by-Step: Writing the Code with Explanations

Let’s now write and explain each line so you truly understand what’s going on.

 

Step 1: Store Your Income

income = 150000

This line creates a variable named income.
We assign it a value of 150000 — representing our monthly earnings.

  • income is a variable of type integer
  • It helps us store the amount of money we have before spending

Think of it like writing down:

“Hey Python, remember that I earn ₦150,000 each month.”

Step 2: Store Your Expenses


rent = 50000
food = 20000
transport = 15000
savings = 30000

These four variables represent how we want to spend our income.

Each one is an integer showing how much we’ll allocate to that category:

  • rent gets ₦50,000
  • food gets ₦20,000
  • transport gets ₦15,000
  • savings gets ₦30,000

Instead of calculating everything in your head, Python will do it for you!

Step 3: Calculate Total Expenses

total_expenses = rent + food + transport + savings

We now add all our expenses together using the + operator.

This line calculates the total money we plan to spend and saves it in a new variable:  total_expenses.

Step 4: Find Out What’s Left

balance = income - total_expenses

This calculates what remains after your planned expenses are deducted from your income.

 

Step 5: Print Everything Out


print("My income is ₦", income)
print("I plan to spend ₦", rent, "on rent")
print("₦", food, "on food")
print("₦", transport, "on transport")
print("₦", savings, "on savings")
print("My total expenses are ₦", total_expenses)
print("I will have ₦", balance, "left at the end of the month")

Here, you’re using the print() function to output the results in a readable way.

Each line shows:

  • How much you earn
  • How much you’ll spend
  • What you’ll have left

💡 We’re combining text and variables in the print() function using commas — no need for f-strings or formatting (we haven’t learned those yet!).

Full Final Code

Here’s the complete code all in one place:


# My monthly income
income = 150000

# My planned expenses
rent = 50000
food = 20000
transport = 15000
savings = 30000

# Calculate total expenses
total_expenses = rent + food + transport + savings

# Calculate what's left
balance = income - total_expenses

# Show results
print("My income is ₦", income)
print("I plan to spend ₦", rent, "on rent")
print("₦", food, "on food")
print("₦", transport, "on transport")
print("₦", savings, "on savings")
print("My total expenses are ₦", total_expenses)
print("I will have ₦", balance, "left at the end of the month")

You can copy this into your Python editor (like VS Code) and run it — and boom — your first Python program!

Your Turn: Customize the Tracker

Try making it your own:

  • Change the income to match your ideal monthly pay
  • Add new expense categories like data or shopping
  • Play around with different values and observe the results

Need Help with a Python Project?

Whether it’s a school assignment, personal challenge, or something you’re stuck on, I’m here to help.

Subtel offers beginner-friendly Python support for:

  • Python assignments
  • Mini projects
  • Code debugging
  • Real-world problem-solving

👉 Contact me now and let’s build something together

What’s Next?

Now that you understand how to use variables to manage numbers, it’s time to dive into the world of text!

➡️ Next up: Python Strings and Text Manipulation for Beginners

We’ll talk about how to store, combine, and play with text using string variables — plus a fun new challenge!

Ready? Let’s go → Read the next post



Need Help with a Python Assignment or Project?

Learning Python is exciting — but it can also get tricky sometimes. Whether you're stuck on a bug, running out of time on an assignment, or building something cool and just need a little help...

We’ve got your back. 💪

Our team is here to support you with:

  • ✅ Python assignments & school projects
  • ✅ Debugging errors or fixing code
  • ✅ Custom scripts or mini tools
  • ✅ Personal coding challenges or portfolio projects

Don’t struggle alone — reach out and let us help you get it done the smart way.

📩 Click here to contact us or

Let’s build something awesome together! Contact Us Now!

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top