#Duck_Typing A traditional idea says: “The king’s son will become the next king.” A more modern interpretation would be: “The one who is capable will become the king.” This transition from identity-based selection to capability-based evaluation loosely resembles Python’s duck typing. In duck typing, an object’s suitability is determined not by its type, but by its behavior. If an object implements the required methods, it can be used — regardless of its class hierarchy. However, it is important to avoid overextending this analogy. Duck typing does not imply merit-based selection or optimization. It simply enables flexibility by accepting any object that satisfies the expected interface. This distinction is critical. #Python #SoftwareEngineering #Programming #Coding #TechConcepts #CleanCode #SoftwareDesign #LearnToCode #DeveloperMindset #TechLearning
Python's Duck Typing: Capability Over Identity
More Relevant Posts
-
Check out my handbook "Fine-tuning Llama 3.2 model with LoRA" ❤️ If you are looking to fine-tune large language models efficiently, I just put together a comprehensive handbook breaking down the entire process using the Llama 3.2 - 1 billion parameter model and parameter-efficient LoRA technique! 🚀 #programming #coding #python
To view or add a comment, sign in
-
🚀 Day 5 – Exploring String Methods in Python Continuing my learning journey with @Global Quest Technologies! Today’s session focused on working with strings and their powerful built-in methods: 🔹 strip() and other essential string methods like split(), join(), replace() 🔹 Case conversion methods – upper(), lower(), swapcase(), title(), capitalize() 🔹 String checking methods – startswith(), endswith() 🔹 String formatting techniques 🔹 Program to accept a string and find its reverse These concepts are very useful for handling and manipulating text efficiently in Python. ✨ Each day brings new knowledge and skills! #Python #LearningJourney #Programming #Coding #Growth
To view or add a comment, sign in
-
-
🧩 DSA Breakdown: Insert Interval One of those problems that looks scary at first, but once you see the pattern — it clicks instantly. The problem: Given a sorted list of non-overlapping intervals, insert a new interval and merge if needed. The trick? Just think in 3 phases: 1️⃣ Add all intervals that END before the new one starts → no overlap, safe to add 2️⃣ MERGE all intervals that overlap → keep expanding the new interval's boundaries 3️⃣ Add everything remaining → they start after the new interval ends ✅ Time: O(n) — single pass ✅ Space: O(n) Currently grinding DSA one problem at a time 💪 If you're on the same journey, let's connect! #DSA #CodingInterview #Python #LeetCode #Programming #100DaysOfCode
To view or add a comment, sign in
-
-
🚀 Day 23 – Second Non-Repeating Character (Python) 💻 Today’s task: Find the second non-repeating character in a string. 🔍 The goal is to identify the second character that appears only once in the given string. 📌 This exercise helped me understand: • Character frequency counting 🔢 • String traversal 🔁 • Handling edge cases efficiently ⚠️ ✨ A slightly advanced twist on a common problem that improves logical thinking. 📈 Learning consistently and strengthening problem-solving skills every day. #Python #100DaysOfCode #CodingJourney #Programming #ProblemSolving #Developer #LearnToCode #Tech #PythonTips #DataStructures
To view or add a comment, sign in
-
-
📘 Python Learning – Day 3 Highlights 🐍 Today’s class was all about Strings & Conditional Logic — very practical and fun! 🔹 String Methods: Used functions like lower(), upper(), strip(), replace(), find(), count(), and split() 🔹 String Formatting: Learned modern and clean way using f-strings 🔹 Conditional Statements: if, elif, else to make decisions in programs 🔹 Ternary Operator: Short and smart way to write conditions in one line 🔹 Practice Programs: ✔ Grade calculation system ✔ Palindrome checker ✔ Vowel counter 💡 Example: text == text[::-1] → checks palindrome Learning how to think logically with code step by step 🚀 #Python #Programming #Coding #LearningJourney #Beginner #TechSkills
To view or add a comment, sign in
-
-
Hello everybody, and welcome to this second personal project of 'Learning Python with me'. Today, I have been asked to create a commission calculator for a friend, and we will use Python to make a simple calculator that shows the percentage commission. What do we need? - Name - Income - Commission result Throughout this project, I realized that I needed to convert strings into integers, since the final result had to be a number. I also learned how to use variables in mathematical operations and print them as a final result. Here is how it looks. I hope you enjoy it! :) #Python #PythonProject #SideProject #fyp #Programming #OpsDeveloper
To view or add a comment, sign in
-
🚀 Day 5 — DSA with Python Solved the classic “Product of Array Except Self” problem today. This one introduced me to an important concept: 👉 Precomputation (Prefix & Suffix Pattern) Instead of recalculating products again and again, I learned how to: • Store prefix products (left side) • Store suffix products (right side) • Combine them to get the result efficiently 💡 Key Learning: Optimizing brute-force solutions using precomputation can significantly reduce time complexity. ⚡ What challenged me: Understanding how to manage two passes (left → right and right → left) without using extra space initially felt confusing — but breaking it step by step helped. 📈 Growth Insight: DSA is less about memorizing solutions and more about recognizing patterns like this one. On to Day 6 🔥 #DSA #Python #CodingJourney #ProblemSolving #100DaysOfCode
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
-
-
🚀 Day 2 of #100DaysOfCode Today I learned how to check whether a number is a Palindrome using Python 🐍 🔍 Problem: A number is called a palindrome if it reads the same forward and backward (like 121, 1331). 💡 Approach: Reverse the number using a loop Compare it with the original number 🐍 Code: num = int(input("Enter a number: ")) original = num reverse = 0 while num > 0: digit = num % 10 reverse = reverse * 10 + digit num = num // 10 if original == reverse: print("Palindrome Number") else: print("Not a Palindrome Number") 📌 Key Learning: Learned how loops and basic logic can solve interesting problems. 💬 Next: Armstrong Number 🔥 #Python #Coding #100DaysOfCode #Learning #CSE
To view or add a comment, sign in
-
-
Day 5/30 This looked correct… until I actually ran it def add(a, b): return a + b Nothing looks wrong here. But then: add("10", 5) It fails Not when I wrote the function… not when Python read it… only when it ran. That’s how I learnt : ➡️ Function definitions don’t enforce types ➡️ The real check happens during execution So the code can look completely fine… and still break later. And that changes how you think about writing code #Python #LearningInPublic #Programming #Developers #30DaysofCode #CodingJourney
To view or add a comment, sign in
-
Explore related topics
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