In my Python learning journey, I’ve officially entered Phase 2, where I explore intermediate programming concepts. After understanding the basics like variables, loops, functions, and conditionals, I felt ready to take the next step. And yes – it was both exciting and a little challenging!

Object-Oriented Programming (OOP)

This was one of the biggest mindset shifts for me. Instead of writing code line-by-line, I began thinking in terms of objects – things with properties and actions. Here’s a simple example of a student class:

With this, I can create a Student object and update or display the data:

This was a huge milestone because it taught me how to organize data and functions together.

File Handling

The moment I learned to read and write from actual text files in Python, it felt like I unlocked a whole new layer of control. For instance, here’s how I use Python to write data to a file and read it back:

Additionally, I also worked with JSON files:

This opened my eyes to how Python can interact with real-world data, and it’s useful for automation, data storage, and more.

Error Handling

Mistakes happen – and Python taught me how to handle them smartly. Here’s an example where I use try and except to prevent errors from crashing my program:

This simple error handling ensures that the program doesn’t break if the user inputs something unexpected, like text instead of a number.

List Comprehensions & Lambda Functions

This part was mind-bending at first, but then it clicked. Here’s a way to use list comprehensions to filter and transform data:

Additionally, lambda functions let me write quick one-liner functions. Here’s an example:

This made my code much cleaner and faster.

Solving Complex Problems

As a test, I built a simple quiz app using everything I’d learned. The app allows users to answer questions, stores scores, and provides feedback:

Final Reflection

his phase was not just about learning Python – it was about learning how to think like a programmer. I’m more confident now in solving real-world problems, organizing code efficiently, and preparing for future projects like automation or AI.

Next up, I’ll continue building small projects, and maybe even share some of them on this blog.