Python Programming
Python Programming
Hey Tim! You’ve been rocking Python for six months, and now youve got three weeks
of school holiday to build something awesome to show off at school or to me. Below are
two project options: an entry-level one (“Mental Math Master”) and a more challenging
one (“Personal Finance Tracker”). Pick one that excites you! Each project is designed
to create a cool product in three weeks. Read through both, choose one, and follow the
plan to make it happen.
• Youll learn Pygame to make a graphical game, which looks super cool.
• Youll finish a playable game in three weeks thats perfect for showing off.
• Tasks:
– Use tuples to store each question, like (operation, num1, num2, answer)
(e.g., (“add”, 5, 3, 8)).
– Use a dictionary to track game state (e.g., {“score”: 0, “level”: 1,
“questions_asked”: []}).
– Set up a Pygame window that shows a math question (e.g., “5 + 3 = ?”) and
lets players type an answer.
1
1.3.2 Week 2: Add More Levels and Scoring
• Goal: Add levels 2 and 3, plus a scoring system.
• Tasks:
– Add level 2 (multiplication, numbers 1–50) and level 3 (division, numbers
1–100). Make sure division questions have whole-number answers.
– Create a scoring system: 10 points per correct answer, +5 bonus points if
answered in under 5 seconds.
– Update the Pygame screen to show the score, level, and feedback (e.g., “Cor-
rect!” in green, “Wrong!” in red).
• What to Do: Code the logic to move players to the next level after 5 correct
answers. Test that scores update correctly and the interface looks clear.
2
1.6 What Youll Show Off
A fun, graphical math game with a leaderboard that your friends can play and compete
on!
• Youll work with databases and charts, which are advanced but doable with focus.
• Youll create a practical app that looks impressive for school or to me.
• Tasks:
– Create a Flask project with pages for the homepage, adding transactions, and
viewing data.
– Set up a SQLite database with a table for transactions (columns: id, date,
amount, category, type [income/expense]).
– Make an HTML form (using Flask-WTF) to let users add income or expense
entries.
• What to Do: Write code to save transactions to the database. Test that you can
add entries through the web form and see them stored.
• Tasks:
– Use Bootstrap or Tailwind CSS (via CDN) to style the app with a clean,
mobile-friendly design.
– Add a page to list all transactions in a table and buttons to delete or edit
entries.
3
– Add error handling (e.g., show a message if someone enters a negative amount
or leaves fields blank).
• What to Do: Code the transaction list page and test editing/deleting entries.
Make sure the app looks nice on your phone or computer.
• Tasks:
– Use Matplotlib to create charts ( bingo: a pie chart for spending by category,
a line chart for balance over time).
– Save charts as images (e.g., chart.png) and display them in the Flask app.
– Build a dashboard page showing total income, total expenses, and current
balance.
• What to Do: Code the dashboard and test that charts update with new transac-
tions. Polish the app to make it user-friendly and bug-free.
• Dashboard: A summary page with financial stats and charts (e.g., spending break-
down).
• Check-Ins: Show me your app weekly to debug or discuss challenges like Flask
routes or SQL.
4
3 How to Choose
• Pick Mental Math Master if you love games, want something familiar, and like
the idea of a visual, playable product.
• Pick Personal Finance Tracker if youre up for a challenge, want to try web
development, and like the idea of a practical, professional app.
Think about what sounds most fun and matches your confidence with new stuff like
Pygame or Flask. Let me know your choice, and lets get coding!