DEV Community

Cover image for What I Learned This Week as a Web Developer (Week 1)" "My Struggles Learning Python: Day 3"
Samuel
Samuel

Posted on

What I Learned This Week as a Web Developer (Week 1)" "My Struggles Learning Python: Day 3"

Hello guys,

so my mentor "Mr Salvation Stanley" @skemuel007 gave me a task to build a Finance Tracker app: This project simulates a basic budgeting tool that users can run on their local machine to input earnings and expenditures, assign them to categories (e.g., food, transport, rent), and view reports. It's a perfect starting point to understand how financial apps work at a foundational level.

<<<<How I started:

  1. Understand the goal and write down on paper lol:
    a. Add/view income and expenses
    b. Categorize transactions
    c. Show monthly summaries (total income, expenses, balance)

  2. I Listed the Required Features
    Add transaction
    View all transactions
    Filter by category/date
    View monthly summary

  3. Organise my Files:
    main.py– User interface (menus, prompts)
    my_tracker.py– Classes: Transaction, FinanceTracker
    my_utils.py– Functions: input validation

<<<What I Learned This Week:

  1. Build Classes : and this was something new for me

  2. BUILD UTILITY FUNCTIONS.

<<<<< What Confused Me
a) Write Input Validation Functions ('utils.py')

validate_amount()' – check if amount is a positive number
validate_transaction_type()` – must be "income" or "expense"
(Optionally: validate date format, category, etc.)

6
a) Use 'json' to store transactions in a file ('transactions.json')
b)Load this file on app start, save on exit

<<<< How I Overcame It
Watched a video by mosh Hammodani codewithmosh.com.
asked chatgpt

  • Built a simple counter app to see closures in action

7 Export Reports

Create a function to export summary (as '.txt' or '.csv')

8 Test All Features

Try adding, viewing, filtering, and checking summary
Try entering wrong values to test exception handling

<<<<CHALLENGES I'm glad I Learnt from.

a. Unsure how to "import" classes and functions from other files.
b. Understanding and Using Classes for the very first time.
c. Forgetting to handle bad input (like typing "abc" for amount).
d. Code crashes or behaves unexpectedly.
e. Struggling with date formatting and parsing using datetime.
f. Error messages can be confusing.
g. Not knowing where the problem is
h. crashes due to small typos.

Top comments (0)