I was going through an OOP concept recently that looked simple on paper. self, cls, instance methods… nothing too advanced. But the more I thought about it, the less “basic” it felt. self is not really just a parameter. It’s what makes an object actually be that object. It’s the moment where structure turns into state. Before that, it’s just a blueprint. After that, it’s something with its own data, its own behavior. And that changes how you think about code. You’re not just writing functions. You’re defining how pieces of a system exist and interact over time. Feels small when you see it. Feels different when you actually understand what’s happening. Curious how often these “simple” concepts end up being the most important ones later on. #SoftwareEngineering #OOP #Python #Programming #ComputerScience
Understanding the Power of Self in OOP
More Relevant Posts
-
At first, I thought creating classes was enough… but then I realized—real power comes from building on top of them. Today’s Python MahaRevision 🧬 Chapter 11: Inheritance & More in OOP This chapter took things a step deeper: → Inheritance (reusing and extending existing classes) → Types of inheritance → Method overriding → Using super() → Exploring more OOP concepts It actually felt like connecting pieces together instead of starting from scratch every time. Practice set done: Worked on creating parent-child classes, modifying behaviors, and experimenting with inherited properties and methods. Biggest takeaway You don’t always need to build everything new—sometimes the smartest approach is to reuse and improve what already exists. Slowly understanding how real-world applications are structured. One step at a time. #Python #LearningInPublic #CodingJourney #Programming #OOP
To view or add a comment, sign in
-
👉 Your code doesn’t become smart… until it learns how to make decisions. 💡 That’s where conditional logic comes in. In Python, we use "if", "elif", and "else" to control what should happen next. age = 18 if age >= 18: print("You can vote") else: print("You cannot vote") Simple, right? But this is powerful. Because now your program is not just running… 👉 It’s thinking based on conditions You can add more situations: marks = 75 if marks >= 80: print("Grade A") elif marks >= 60: print("Grade B") else: print("Grade C") 💡 This is how programs: • Make decisions • Handle different situations • React to user input And honestly… We use conditional logic in real life every day: 👉 If it rains → take an umbrella 👉 If you’re tired → take rest 👉 Else → keep working 💡 That’s the real idea: Conditional logic = decision making Are you just writing code… or teaching it how to think? #Python #LearnPython #CodingBasics #ConditionalLogic #ProgrammingConcepts #Ifelse #CodingForBeginners #TechEducation #LearnWithMe
To view or add a comment, sign in
-
-
🐍 Day 8 of Learning Python — and things are getting real! Today's lab was all about writing code that doesn't break (or at least fails gracefully 😄). Here's what I worked through: ✅ Exception Handling — try / except / else / finally • Caught ZeroDivisionError, FileNotFoundError, ValueError, and TypeError • Used `raise` to throw custom error messages • Built my own exception class: TooSmallError 🎉 ✅ Standard library deep dive: • math — calculated circle areas, factorials, GCD, and compound interest • random — shuffled lists, simulated 1000 coin flips, generated reproducible sequences with seed() • datetime — parsed date strings, added time deltas, sorted ISO dates, and printed 5-day schedules ✅ Introspection with dir() and help() The biggest lesson today? Real-life programs don't always get perfect input. Learning to handle errors gracefully is just as important as writing the happy path. Day by day, the pieces are coming together. 💪 #Python #100DaysOfCode #LearningToCode #PythonProgramming #CodingJourney #Day8
To view or add a comment, sign in
-
Not every valuable lesson comes from a complex project. 🍦 In college, I built a Python program to help a local ice cream shop calculate their weekly ice cream sales volume — based on cone sizes sold per day. The real challenge wasn't the code. It was the planning: → Define the output → Identify the inputs → Map the process → Write pseudocode → Desk-check before running anything Plan first. Code second. That mindset is something I carry into every IT problem I solve today. #Python #Coding #ITCareer #ProblemSolving #CollegeLearning #TechSkills
To view or add a comment, sign in
-
Hi guys, I know it’s delayed—now let’s dig into Python again for this post! 💭 Day 3 with Python… something finally clicked. The errors didn’t stop. The confusion didn’t magically disappear. But today… I wrote something that actually worked. Not just print("Hello, World!") Not just fixing errors… 👉 I made decisions in my code. Using if...else, my program could finally think (at least a little 😄) “IF this happens → do this” “ELSE → do something else” And suddenly, coding didn’t feel like typing… It felt like logic coming to life. 💡 That’s when I realized: Programming isn’t about memorizing syntax. It’s about teaching a machine how to think step by step. Every small concept—conditions, loops, functions— They’re not just topics… They’re building blocks of something bigger. Today it’s simple decisions. Tomorrow? Maybe something powerful. ✨ Step by step… line by line… growth is happening. #Python #CodingJourney #Day3 #LearnToCode #Programming #DeveloperLife #LogicBuilding #TechGrowth 🚀
To view or add a comment, sign in
-
🚀 Day 21 – Merge Two Sorted Lists (Python) 💻 Today’s task: Write a program to merge two sorted lists into a single sorted list. 🔍 The goal is to combine both lists while maintaining the sorted order. 📌 This exercise helped me understand: • Two-pointer technique 🔁 • Efficient list traversal ⚙️ • Writing optimized and clean logic ✨ ✨ A classic problem that builds a strong foundation for algorithms like merge sort. 📈 Learning step by step and improving consistency every day. #Python #100DaysOfCode #CodingJourney #Programming #ProblemSolving #Developer #LearnToCode #Tech #PythonTips #DataStructures
To view or add a comment, sign in
-
-
Week 4 of #100DaysOfCode — done! 🎉 Last week I learned how to build classes. This week I learned how to make them talk to each other. Topics covered: 🧹 Inheritance → Superclass, subclass, base class — and what they actually mean → How Python finds attributes (spoiler: it walks up the chain) → Overriding methods — and extending them with super() → isinstance, issubclass, type — when to use which → Multiple inheritance + MRO (Method Resolution Order) 🏗️ Abstract Classes & Interfaces → ABC + @abstractmethod — enforcing a contract on subclasses → Duck typing — "if it has a speak() method, it speaks" → Subclassing built-ins (list, dict, iterator) → Mixins — plugging in behaviour without full inheritance I’ve structured my learning into notes and practical examples to better understand the concepts : https://lnkd.in/epaBymnJ #100DaysOfCode #Python #OOP #LearningInPublic #Programming
To view or add a comment, sign in
-
I got tired of scrolling through messy file names… so I fixed it with a small Python script. While reading One Piece manga PDFs, the file names were all over the place: chapter-1112, one-piece-chapter-1222, onepiece-1123, OP-Chapter-1123… Finding the correct order every time was annoying. So I wrote a simple script that: Extracts the chapter number from any format Renames files into a consistent structure Automatically arranges them in readable order Nothing fancy just solving a small personal problem and saving time. This reminded me: You don’t always need big projects. Even small scripts that remove friction from your daily life are worth building. Clean input → Clean output → Peace of mind 😌 #Python #LearningByDoing #Automation #OnePiece #Coding
To view or add a comment, sign in
-
-
I did not expect a Python topic about “unique items” to feel this useful… but sets changed that fast. 🐍 Day 7 of my #30DaysOfPython journey was all about sets, and this one felt different because it was less about storing data and more about controlling it. A set is an unordered collection of distinct items. It cannot hold duplicates, which makes it super handy in real-world coding. Today I explored: 1. Creating sets with set() built-in function and {} 2. Checking length with len() 3. Using in to check if an item exists 4. Adding items with add() to add a single item and update() for multiple items 5. Removing items with remove() (raise error if item not present), discard() (does not raise error), and pop() (removes a random item) 6. Clearing a set with clear() 7. Deleting a set with del 8. Converting a list to a set to remove duplicates 9. Set operations like union(), intersection(), difference(), and symmetric_difference() 10. Checking issubset(), issuperset(), and isdisjoint() What made sets interesting to me today was how practical they are when you want uniqueness, comparison, or clean data without duplicates. They may look simple on the surface, but they solve a very specific kind of problem really well. Which Python data type has surprised you the most so far: lists, tuples, or sets? Github Link - https://lnkd.in/eJfTX-HQ #Python #LearnPython #CodingJourney #30DaysOfPython #Programming #DeveloperJourney
To view or add a comment, sign in
-
Day 5/365: Checking Armstrong Numbers in Python 🔢🧠 Today I worked on a classic number theory problem: checking whether a number is an Armstrong number. A number is an Armstrong number if the sum of its own digits each raised to the power of the number of digits is equal to the original number. For example: 153 has 3 digits 1³ + 5³ + 3³ = 1 + 125 + 27 = 153 So 153 is an Armstrong number. What this function does: First, I store a copy of the original number so I can compare at the end. Then I find how many digits the number has using len(str(copy)). Inside the loop, I extract each digit, raise it to the power of the number of digits, and keep adding it to a running sum. Finally, I compare the sum with the original number: If they are equal, it’s an Armstrong number. Otherwise, it’s not. What I learned from this exercise: How to break a number down digit by digit using % 10 and // 10. How to combine math (powers) with loops and conditionals to implement a rule. The importance of keeping a copy of the original value when you are modifying it in a loop. Day 5 done ✅ 360 more to go. If you have any variations of this problem (like finding all Armstrong numbers in a range or handling user input with validation), share them—I’d love to try them out. #100DaysOfCode #365DaysOfCode #Python #LogicBuilding #ArmstrongNumber #NumberTheory #CodingJourney #LearnInPublic #AspiringDeveloper
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development