🐍 Weekly Reflection: Phase 2 – Leveling Up with Intermediate Python

This week brought a big change on my route to learning Python: progress from the beginner levels to intermediate. Phase 2 emphasized using my understanding of functions, loops, and conditionals in more formal, efficient, and relevant programming knowledge.

Here’s how my week unfolded and what I discovered while diving deeper into Python.

🧱 Object-Oriented Programming (OOP): Making Code Modular

One of the most powerful concepts I learned this week was Object-Oriented Programming. Creating classes and objects felt like a huge step up in organizing code more efficiently. Instead of writing standalone functions, I started thinking in terms of objects with properties and behaviors.

πŸ” What I Practiced:

  • Creating a BillCalculator class to encapsulate bill-related logic
  • Using __init__() to initialize object data
  • Adding methods to perform tasks like calculating tax and splitting bills

πŸ’‘ Reflection:
Thinking in OOP has made my code cleaner, more readable, and easier to expand. I now see how large-scale applications are built using this structure.

πŸ“‚ File Handling: Storing and Retrieving Data

Next up, I explored reading and writing to files. This was my first step into making programs that actually store information, and it was pretty exciting to save data from my calculator into a .txt file.

πŸ” What I Tried:

  • Writing total bills and tax details to a file
  • Reading from files to display saved logs

πŸ’‘ Reflection:
Now I can log user data, which is huge for building apps that track history or require persistence. I’m also more confident working with file paths and basic I/O errors.

❗ Error Handling: Writing Safer Code

This week, I also explored how to use try-except blocks to make sure my programs don’t crash when things go wrongβ€”like when a user inputs text instead of a number.

πŸ” What I Practiced:

  • Catching ValueError for invalid numeric input
  • Displaying helpful messages instead of stack traces

πŸ’‘ Reflection:
This has made me less afraid of errors. Now, I can handle problems gracefully and provide users with clear feedback, which is key in real applications.

πŸ§ͺ Challenges I Solved This Week

I pushed myself to solve more complex problems by combining what I learned. A few examples:

  • Refactored my restaurant bill calculator into an OOP structure
  • Logged bill data into a file with automatic tax calculation
  • Handled exceptions gracefully to prevent user crashes

🎯 Next Steps for Phase 3

Heading into Phase 3, I plan to:

  • Start building a larger project that uses everything I’ve learned
  • Explore automation and web scraping
  • Try basic data analysis using pandas
  • Push my skills further with interactive applications (like using Tkinter or Flask)