Sananth Badhran

Category: Inquiry

This is the category to apply to your Inquiry posts.

Assignment 1 – Deeper Dive Inquiry (3 of 4), Documentation of the Learning Process

This week, I took a deeper dive into some of Python’sĀ most powerful building blocks:Ā methods, classes, arrays, and lists. It was both exciting and a bit brain-bending, but I’m finally starting to see how these tools come together to make Python such a flexible and efficient language.

🧱 Classes & Objects: Building Your Own Structures

At first, classes felt abstract. I wasn’t sure why I’d use them when functions seemed to get the job done. But once I actually created my own class and instantiated objects from it, I realized:Ā classes are like templates for real-world things.

Here’s a simple example I practiced with:

āœ… I now understand how to:

• Use __init__ to set object properties

• Define methods to perform actions inside the class

• Create multiple instances of the same class with different data

Ā OOP makes codeĀ more reusable and organized. I used to write separate functions for every variation of a problem—now I just create objects!

🧰 Methods: Actions That Belong to Objects

UnderstandingĀ methodsĀ (especially how they differ from regular functions) helped me think more like a software developer. A method is basicallyĀ a function that ā€œbelongsā€ to a class.

I practiced creating methods to:

• Calculate values (calculate_tax())

• Update attributes (like adjusting the bill)

• Print or return data in a formatted way

Ā Methods help keep data and logicĀ encapsulated. It’s clean, efficient, and avoids unnecessary repetition.

šŸ“š Lists: The Swiss Army Knife of Python

Python lists are incredibly versatile. I used them to store groups of numbers, strings, and even objects I created from classes.

Example:

I also practiced:

• Looping through lists with for loops

• Adding/removing items with .append() and .remove()

• Using list comprehensions to simplify code

Lists are essential for managingĀ collections of data. Learning list comprehension was a game-changer—it made my code cleaner and faster.

šŸ”¢ Arrays: A More Specialized Tool

While lists are flexible, I learned thatĀ arraysĀ (from theĀ arrayĀ module or libraries like NumPy) are more efficient for large amounts of numerical data.

I now understand the difference:

• Lists = general-purpose, can store anything

• Arrays =Ā faster and more memory-efficient, but only for numbers of a single type

šŸ”„ Bringing It All Together: Small Project Idea

TheĀ Student Grade Management System

🧠 Here’s what the system will be able to do:

1. āœ… Add a new student

2. šŸ“‹ Add grades to a student

3. šŸ“Š Calculate a student’s average

4. šŸŒŸ Show top student(s)

5. šŸ” Search for a student by name or ID

6. šŸ’¾ Save and load data from a file

7. šŸ—‘ļø Optional: Delete a student

Assignment 1 – Deeper Dive Inquiry (2 of 4), Documentation of the Learning Process

šŸ 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)

Assignment 1 – Deeper Dive Inquiry (1 of 4), Documentation of the Learning Process

My Python Learning Journey: From Basics to Building Projects šŸšŸ’»

šŸš€ Introduction: Why I Chose Python?

In my learning plan, I set a goal to learn Python to enhance my career opportunities in technology, automation, and engineering applications. As part of my inquiry-based learning, I have explored Python fundamentals, worked on small projects, and documented my learning along the way.

šŸ’” Why Python?

āœ” Easy to learn ā€“ Simple syntax, beginner-friendly.

āœ” Industry relevance ā€“ Used in data analysis, automation, AI, and cloud computing.

āœ”Ā Practical applications – Can be used forĀ structural analysis, traffic simulations, and automation tasks.

šŸ”—Ā Resources I Used:

• Python for Beginners

• W3Schools Python Tutorial

šŸ“š My Learning Process & Key Takeaways

Phase 1: Python Fundamentals

I started with theĀ basicsĀ of Python, including

āœ” Variables & Data Types

āœ” Loops & Conditional Statements

āœ” Functions & Error Handling

šŸ›  Problems I Solved in Phase 1

1ļøāƒ£ Problem: Finding the Longer of Two Strings

Task:

• Write a function get_longer(str1, str2) that returns the longer of two strings.

• If both strings are the same length, return the first argument.

šŸ’”Key Concept Learned:

āœ” Using Python’s built-in len() function to compare string lengths.

āœ” WritingĀ conditional logicĀ usingĀ if-elseĀ statements.

2ļøāƒ£ Problem: Calculating Tax on Food & Alcohol

Task:

• Write a function get_tax(food_cost, alcohol_cost) that calculates the total tax on restaurant bills.

• Tax rules:

• Food: 5% GST, 0% PST.

• Alcohol: 5% GST, 10% PST.

• Don’t round the final value.

šŸ’”Key Concept Learned:

āœ” Handling floating-point arithmetic in Python.

āœ” Structuring functions toĀ handle real-world tax calculations.

šŸš€ Next Steps After Phase 1: Building on the Basics

Phase 2: Expanding into Intermediate Python Concepts

Now that i have understandĀ functions, loops, and conditionals, it’s time toĀ level upĀ by learning:

šŸ”¹Ā Object-Oriented Programming (OOP) – Learn aboutĀ classes and objectsĀ to structure your code better.

šŸ”¹Ā File Handling – Work withĀ reading/writing text files, CSVs, and JSON.

šŸ”¹Ā Error Handling – Learn how to useĀ try-except blocksĀ to make your programs more robust.

šŸ”¹Ā List Comprehensions & Lambda Functions – Write moreĀ concise and efficientĀ code.

šŸ”¹ Solve More Complex problems

Digital Literacy Inquiry

Assignment 1: Deeper Dive Inquiry process posts and summary posts will be shared using the category “Inquiry,” as this post does. As you can see, it is set up to pull these posts into the Inquiry menu on your blog.

© 2025 My Digital Domain

Theme by Anders NorenUp ↑