Day 16/100: Transitioning from Logic to Objects! Today was a turning point in my #100DaysOfCode journey. I moved away from "Procedural Programming" and dived deep into Object-Oriented Programming (OOP). What I explored today: Classes vs. Objects: Understanding that a Class is a blueprint (like a house map) and an Object is the actual house. The Turtle Graphics: Using the Turtle class to understand how methods and attributes work in real-time. Abstraction: Learning how to use complex code written by others without needing to know every internal detail. Main Project: Coffee Machine (OOP Version) I rebuilt the Day 15 Coffee Machine project, but this time using OOP. Instead of one long script, I used separate classes for the Menu, CoffeeMaker, and MoneyMachine. This made the code incredibly organized and modular. OOP felt a bit strange at first, but seeing how it simplifies large-scale projects is a game-changer! Check out my OOP-based Coffee Machine here: https://lnkd.in/gAfvCxFy #Python #OOP #ObjectOrientedProgramming #100DaysOfCode #SoftwareArchitecture #VSCode
Transitioning to OOP: Classes, Objects & Abstraction
More Relevant Posts
-
Topic 8/100 🚀 🧠 Topic 8 — Higher-Order Functions What if functions could take other functions as input… or even return them? 🤯 👉 What is it? Higher-order functions are functions that either: Accept other functions as arguments, OR Return a function as output 👉 Use Case: Used in real-world applications for: Functional programming patterns Data transformations (map, filter) Building reusable logic 👉 Why it’s Helpful: Promotes code reuse Makes logic more flexible Enables cleaner and modular design 💻 Example: def apply_operation(func, value): return func(value) def square(x): return x * x result = apply_operation(square, 5) print(result) 🧠 What’s happening here? We passed the square function as an argument to another function and executed it dynamically. ⚡ Pro Tip: Master this concept to unlock functional programming in Python. 💬 Follow this series for more Topics #Python #BackendDevelopment #100TopicOfCode #SoftwareEngineering #LearnInPublic
To view or add a comment, sign in
-
-
Day 7/10 🚀 This is where your code grows up. Modules & Packages — the foundation of every scalable Python project. Without them? Spaghetti code, repetition, no structure. With them? Clean, reusable, production-ready code. 📋 What I covered today: 01 → Modules & package structure 02 → Creating & importing .py files 03 → init.py & sub-packages 04 → Import styles — import, from, alias 05 → Relative vs absolute imports 06 → Standard library — os, json, datetime, re 07 → Third-party packages — pip, numpy, pandas 08 → Virtual environments & requirements.txt 09 → Mini Project — Config Loader Package Built a small config package with loader & validator modules — a real-world pattern used in production apps. Day 1 ✅ Day 2 ✅ Day 3 ✅ Day 4 ✅ Day 5 ✅ Day 6 ✅ Day 7 ✅ 3 more to go. Drop a 📦 if you’ve ever put everything in one giant .py file 😄 #Python #Modules #Packages #DataEngineering #LearningInPublic #CleanCode #10DaysOfPython #SoftwareEngineering
To view or add a comment, sign in
-
Topic 7/100 🚀 🧠 Topic 7 — Lambda Functions Want to write a quick function in just one line? ⚡ 👉 What is it? Lambda functions are small anonymous functions defined using the lambda keyword. 👉 Use Case: Used in real-world applications for: Quick operations inside map(), filter() Sorting with custom logic Short, throwaway functions 👉 Why it’s Helpful: Reduces boilerplate code Makes code concise Useful for functional programming 💻 Example: # Normal function def square(x): return x * x # Lambda version square = lambda x: x * x print(square(5)) 🧠 What’s happening here? We replaced a full function definition with a single-line lambda expression. ⚡ Pro Tip: Use lambdas for small logic only — avoid them for complex functions. 💬 Follow this series for more Topics #Python #BackendDevelopment #100TopicOfCode #SoftwareEngineering #LearnInPublic
To view or add a comment, sign in
-
-
I just published a compact guide on Medium diving into the 5 Design Patterns every Python architect needs. We're moving past simple scripts and into scalable architecture. What's inside: ✅ Singleton: Managing global state without the mess. ✅ Factory: Decoupling creation from business logic. ✅ Observer: The backbone of event-driven systems. ✅ Protocols: Clean, type-safe Pythonic interfaces. ✅ Strategy: The ultimate cure for "If-Else" spaghetti. If you’re aiming for that Senior title or just want to write more maintainable code, this is for you. #Python #SoftwareArchitecture #Coding #SeniorDeveloper #DesignPatterns #Programming #TechLead
To view or add a comment, sign in
-
24/100: Mastering File Systems & Automation! After building games for the last few days, today I shifted my focus toward File Handling and Automation in Python. This is where coding starts to solve real-world administrative tasks! Key Learnings from Day 24: File I/O: Understanding the difference between read, write, and append modes. The "With" Keyword: Learning how to manage file resources safely using context managers (no more manual .close()!). Mail Merge Project: Built a script that automates personalized letters. It takes a list of names and a template, then generates individual files for each person. Automating repetitive tasks like these is exactly why Python is so powerful in the business world. #Python #100DaysOfCode #Automation #FileHandling #Programming #VSCode
To view or add a comment, sign in
-
Currently revising Object Oriented Programming and Inheritance is the concept that truly separates beginner code from professional code 🏗️ Image from GeeksforGeeks illustrates it beautifully. The idea is simple but powerful: 1️⃣ Create a PARENT class with common properties & methods 2️⃣ Child classes INHERIT everything automatically 3️⃣ Child classes can also ADD their own unique behavior 4️⃣ No repetition. No redundancy. Clean code. This is called the DRY principle Don't Repeat Yourself. In real world projects: 🔹 TensorFlow's Layer class every layer inherits from it 🔹 FastAPI's BaseModel your models inherit from it 🔹 Pydantic schemas pure inheritance in action You use inheritance every single day without even realizing it. The bigger the project, the more critical inheritance becomes. It's not just a concept it's what keeps large codebases maintainable. Image credit: GeeksforGeeks #Python #OOP #Inheritance #SoftwareEngineering #MachineLearning #PythonDev
To view or add a comment, sign in
-
-
🚀 Mastering the art of loops! 🔄 Discover how loops help your code execute repetitive tasks efficiently. Essentially, loops are like a magical chant that tells your program to keep doing something until a certain condition is met. For developers, mastering loops is crucial for automating tasks and iterating over data structures with ease. Here's the breakdown: 1️⃣ Initialize a counter variable 2️⃣ Set the condition for the loop 3️⃣ Define the action to perform in each iteration Sample code using a "for" loop in Python: ``` for i in range(5): print("Hello, World!") ``` 🌟 Pro Tip: Use loops to reduce redundancy in your code and boost efficiency. 💡 ⚠️ Common Mistake: Forgetting to update the counter variable in the loop, leading to an infinite loop! 🔄 🌟 What's your favorite use case for loops in your projects? Let's discuss! 💬 #Coding101 #LearnToCode #TechTips #CodeNewbie #PythonProgramming #DeveloperCommunity #LoopLogic #CodeEfficiency #ProDevSkills 🌐 View my full portfolio and more dev resources at tharindunipun.lk
To view or add a comment, sign in
-
-
I’ve just wrapped up a major milestone in my backend journey — implementing asynchronous processing in my Task Manager project, and the results are What I built: Sync vs Async API comparison endpoints Concurrent request handling using async routes External API integration with parallel calls Clean UI dashboard to visualize performance differences Results: Sync execution: 2160 ms Async execution: 1586 ms ~574 ms faster with async! This clearly shows how asynchronous programming can significantly improve performance when dealing with multiple I/O operations. Key Takeaways: Async = better scalability & responsiveness Perfect for external API calls & high-load systems Clean architecture makes debugging & scaling easier Tech Stack: FastAPI | Python | Async/Await | HTTPX | SQLite | Custom UI This phase really helped me understand how modern backend systems handle concurrency efficiently. #BackendDevelopment #Python #FastAPI #AsyncProgramming #WebDevelopment #SoftwareEngineering #LearningInPublic #100DaysOfCode
To view or add a comment, sign in
-
House Robber II - LeetCode 213 - Medium Today, I solved the House Robber II problem, which adds a circular constraint to the original challenge. In this version, all houses are arranged in a circle, meaning the first and last houses are neighbors. Breaking into both would trigger the alarm. To solve this, I used a strategy to break the circular dependency by converting it into two separate linear sub-problems. Since we cannot rob both the first and the last house, the problem can be split into two cases: one excluding the last house and one excluding the first house. By applying the standard house robber logic to both cases and taking the maximum, we find the global optimal solution. Key Learnings 1) Circular Constraint Management: Learned how to handle dependencies in a circular data structure by breaking it into linear segments. 2) Code Reusability: Reused the logic from House Robber I as a helper function to solve the two sub-problems efficiently. 3) Problem Decomposition: Observed how a complex constraint can be simplified by considering mutually exclusive scenarios. Time and Space Complexity Time Complexity: O(N) — We traverse the houses twice, resulting in a linear time complexity. Space Complexity: O(N) — We use a DP array to store the maximum profit for each sub-problem. (Note: This can be optimized to O(1) using variables). #LeetCode #DynamicProgramming #Blind75 #SDEPrep #DataStructures #Python #ProblemSolving #CodingJourney #Freshers
To view or add a comment, sign in
-
-
🚀 Learn Python in 30 Days (Simple Plan) Week 1: Basics 👉 Variables, data types, if-else, loops Week 2: Core Concepts 👉 Lists, dictionaries, functions, file handling Week 3: Intermediate 👉 OOP, modules, error handling + practice problems Week 4: Real Skills (choose one) 💻 Web (Flask) 📊 Data Science (Pandas, NumPy) 🤖 Automation (scripts, bots) Daily Routine (1–2 hrs): ✔ Learn → Practice → Build 💡 Tip: Don’t just watch tutorials — code every day. #Python #Coding #LearnToCode #Developer
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