Build a Simple Household Budget Calculator with GitHub Copilot
Write a small calculator that adds your monthly expenses — Copilot helps you write the code, line by line.
In short: GitHub Copilot is an AI helper that lives inside a code editor and suggests code as you type. In about 15 minutes you can build a tiny calculator that adds your monthly expenses and prints a total, even if you've never written a line of code before. Copilot writes the suggestions, but you still type the run command and check the math yourself.
You don't need a programming background for this one. Think of Copilot like a friend sitting next to you: you describe what you want in plain English, and it drafts the code. You review it, change a few numbers, and run it. By the end you'll have a small file on your computer that adds up any list of expenses you give it.
💡 Tip: tap a step’s number when you finish it — a green tick appears and your browser remembers how far you got.
- A GitHub account (free at github.com — you'll need it to sign into Copilot).
- Visual Studio Code, a free code editor from Microsoft (download and install it like any other program). It works on Windows, Mac and Linux.
- The GitHub Copilot extension installed inside VS Code and signed in. A free tier exists; paid tiers give higher usage limits. Check the current plans on GitHub's official pricing page.
- Python installed on your computer (free from python.org) — needed only if you want to run the calculator yourself. If you'd rather not install anything, you can paste the code into a free online Python runner instead.
- About 15–20 minutes total.
Open VS Code and confirm Copilot is ready
Open Visual Studio Code. When it starts, you'll see a large empty white area in the middle (where you'll write your code), a narrow sidebar on the left, and a thin menu bar across the top with File, Edit, View and other items. In the left sidebar, open the Extensions view — usually an icon made of four small squares, or you can reach it from the View menu at the top by choosing Extensions. Type GitHub Copilot into the search box, click the result published by GitHub, then click Install. A sign-in window may pop up asking for your GitHub account details. If you've installed Copilot before, the sign-in may already be done, and you'll see a small status message near the bottom of the window. If you can't find the Extensions icon, try the View menu — every recent version of VS Code puts it there.
You'll know it worked when the install finishes and the bottom of the window shows Copilot as ready (the exact wording varies by version).

Create a new Python file for your budget
Go to the File menu at the top and choose New File (or press Ctrl+N on Windows, or Cmd+N on Mac). A blank white page opens in the middle of the editor. Save it right away with File → Save As, then type the name budget.py and pick a folder you can find again — your Desktop or Documents folder works well. The .py at the end tells the editor this is a Python file, which helps Copilot give better suggestions. The tab at the top of the editor should now show your file's name. If VS Code asks you to pick a language, choose Python. If you don't have Python installed on your computer, that's okay for this step — the file will still save as plain text, and you can install Python later or use an online runner.
You'll know it worked when the tab at the top of the editor shows "budget.py" with a small colored Python logo next to it.

Describe your budget in plain English
Move your cursor into the empty file and start typing a comment. A comment in Python starts with the # symbol — the computer ignores it, but Copilot reads it to understand what you want. Type your comment slowly. After a few words, Copilot may start suggesting the rest of the line in ghosted gray text. Don't worry about writing perfect English; just describe your goal clearly. If no gray suggestion appears right away, that's normal — Copilot often waits until you press Enter or pause for a second after typing.
You'll know it worked when a line of ghosted gray text appears right after your comment.

Accept the suggestion and review the code
When the gray suggestion looks reasonable, press the Tab key to accept it. The ghosted text turns into real, editable code. If the suggestion looks wrong, press Esc to dismiss it, then edit your comment to be clearer and wait for a new suggestion. After accepting the first line, Copilot usually suggests the next line below it — press Tab again to accept each one. You'll likely end up with something like a list of numbers, a line that adds them together, and a line that prints the result. You don't have to understand every word of the code — the point is that you now have a working draft.
You'll know it worked when your file has several lines of code below your original comment.

Run the calculator to see your total
Now you'll make the calculator actually do its job. Look at the top menu bar for Terminal, click it, and choose New Terminal (the wording can vary slightly between Mac, Windows and Linux). A text panel slides up from the bottom of the window. In that bottom panel, type python budget.py and press Enter. If Python is installed, you'll see one line appear with your total — something like "Your total monthly expenses are: $1675." If you see an error like "python: command not found," Python isn't installed yet — either install it from python.org, or paste your code into a free online Python runner to see the result there.
You'll know it worked when a single line with a dollar amount appears in the bottom panel.

Change the numbers to match your own expenses
The numbers Copilot suggested are just placeholders. Click back into the top part of VS Code (the file itself) and find the list of numbers — it usually looks like expenses = [1200, 350, 80, 45]. Replace each number with a real expense from your life: rent, groceries, phone bill, gym, streaming subscriptions, anything that repeats each month. Keep the commas between the numbers and keep everything inside the square brackets [ ]. Press Ctrl+S on Windows or Cmd+S on Mac to save, then go back to the terminal panel and run python budget.py again. Your new total appears. If you see a red "SyntaxError" message, you probably forgot a comma or a bracket — check the brackets and commas carefully.
You'll know it worked when the new total in the terminal matches the sum of the numbers you typed (1500 + 400 + 60 + 30 + 25 = 2015).

- Forgetting to save before running. The terminal reads the file from disk, not what you see on screen. If you change the numbers but don't save, you'll keep getting the old total. Press Ctrl+S (or Cmd+S on Mac) every time you edit, then run again.
- Missing a comma or a bracket in the list. Python lists need commas between numbers and matching square brackets. Without them, you'll see a red "SyntaxError" in the terminal. Check that every number except the last has a comma after it, and that you have both an opening [ and a closing ].
- Asking Copilot something it can't actually do here. Copilot is great at writing small code snippets like this, but it can't pull your real bank statements, read your email receipts, or do your taxes. Use this calculator for rough monthly planning, and a real budgeting app if you want automatic tracking.
Open VS Code, create a new file called budget.py, and type this exact comment: # A simple budget calculator that adds monthly expenses and prints a total. Then pause for a second. Watch what Copilot suggests in gray — press Tab to accept it, and you have a working starter in under a minute.
❓ Quick questions
How long does this take?
About 6 minutes — the guide has 6 steps, and you can tick each one off as you go.
Which tool do I need?
This guide uses GitHub GitHub Copilot — but the approach works very similarly in other AI assistants.
Do I need to prepare anything?
- A GitHub account (free at github.com — you'll need it to sign into Copilot).
- Visual Studio Code, a free code editor from Microsoft (download and install it like any other program). It works on Windows, Mac and Linux.
- The GitHub Copilot extension installed inside VS Code and signed in. A free tier exists; paid tiers give higher usage limits. Check the current plans on GitHub's official pricing page.
- Python installed on your computer (free from python.org) — needed only if you want to run the calculator yourself. If you'd rather not install anything, you can paste the code into a free online Python runner instead.
- About 15–20 minutes total.
What mistakes should I avoid?
- Forgetting to save before running. The terminal reads the file from disk, not what you see on screen. If you change the numbers but don't save, you'll keep getting the old total. Press Ctrl+S (or Cmd+S on Mac) every time you edit, then run again.
- Missing a comma or a bracket in the list. Python lists need commas between numbers and matching square brackets. Without them, you'll see a red "SyntaxError" in the terminal. Check that every number except the last has a comma after it, and that you have both an opening [ and a closing ].
- Asking Copilot something it can't actually do here. Copilot is great at writing small code snippets like this, but it can't pull your real bank statements, read your email receipts, or do your taxes. Use this calculator for rough monthly planning, and a real budgeting app if you want automatic tracking.
Keep reading
✦ Original step-by-step guide by AI World HQ's AI editorial team. Written in plain language, reviewed for accuracy.
← Back to all stories