🚀 Python Tip: len(obj) -> obj.__len__() next(obj) -> obj.__next__() Built-in functions delegate behavior to dunder (double-underscore) methods implemented on objects. That’s how Python lets your own classes behave like built-in types. #Python #PythonTips #PythonProgramming #LearnPython #CodeNewbie #100DaysOfCode #Programming #SoftwareEngineering #CleanCode #PythonInternals #PythonTricks #DevTips
Alican Dönmez’s Post
More Relevant Posts
-
Python Logic: Is this Math or Magic?🤔 Day 8 of my Python journey! C++ logic tells me: You can't add words to numbers. Python logic says: Hold my coffee ☕ Check out this snippet: result = True + True + False * True What do you think the print(result) output will be? Drop your guess in the comments! 👇 A) True B) 2 C) 3 D) Error Hint💡: It comes down to how Python stores Booleans as Integers! #Python #LearninginPublic #30DaysOfCode #ProgrammingLogic #Day8
To view or add a comment, sign in
-
-
Poll Insight: Which data type does not allow duplicate values? The correct answer is Set ✅ A Set stores only unique elements, meaning duplicate values are automatically removed. That’s why sets are useful when you want to keep only distinct values in Python. 👉 Example use cases include removing duplicates from a list or storing unique items. #Python #LearnPython #CodingQuiz #ProgrammingBasics
To view or add a comment, sign in
-
Python Dictionaries & Tuples Today I learned about Tuples and Dictionaries in Python and explored how they work. Tuples Used to store multiple values Immutable (values cannot be changed after creation) Dictionaries Store data in key–value pairs Very useful for structured data While practicing, I also tried some dictionary methods like: pop() popitem() Understanding these core data structures is helping me build stronger Python fundamentals step by step. Thanks Hitesh Choudhary sir for explaining these concepts so clearly. #LearnInPublic #Python #Programming #BackendJourney
To view or add a comment, sign in
-
-
Python Tip of the Day 🐍 Choosing the right file mode in Python is more important than it seems. w and w+ may look similar, but they serve different purposes: w → Write only w+ → Write + Read Both modes create the file if it doesn’t exist and overwrite existing data, which makes them powerful—but also risky if used carelessly. Day 43 of building Python basics #Python #FileHandling #LearnPython #ProgrammingBasics #PythonTips
To view or add a comment, sign in
-
-
Python Tip of the Day 🐍 Working with strings isn’t just about storing text — it’s about understanding how to search and analyze it efficiently. Methods like count(), index(), rindex(), and find() help you locate and evaluate data with precision. Day 39 of building Python basics. #Python #Programming ##DataAnalytics #SoftwareDevelopment #LearnPython
To view or add a comment, sign in
-
-
Python Challenge #1 – Answer Revealed! b = a[:] ---> creates a shallow copy of a. So a and b are separate lists. Appending 4 to b changes only b, not a. #python #code #programmer #challenge #trending #list
To view or add a comment, sign in
-
-
When working with different data types, Python requires explicit conversion. Here, numbers and boolean values are converted into strings before combining them. This ensures that all parts are of the same type during concatenation. Answer: A) 52False #Python #TypeCasting #MathModule #PythonBasics #LearningInPublic #ProblemSolving #CodingPractice
To view or add a comment, sign in
-
-
Here's a Python collections challenge from @dontmisstmr — can you get it right without running the code? from collections import Counter data = [1, 2, 2, 3, 3, 3, 4, 4] top_element = Counter(data).most_common(1) print(top_element) Counter is one of Python's most underrated built-ins. Do you know what format most_common(1) returns? Drop your answer in the comments! #Python #SoftwareDevelopment #CodingChallenge #ProgrammingTips #TechCommunity
To view or add a comment, sign in
-
Python Object Manipulation Today I was experimenting with Python’s metaclasses and object creation flow, and something interesting happened. ◽ What looks simple: obj = MyClass() actually goes through multiple internal steps: 1️⃣ type.__call__() 2️⃣ MyClass.__new__() 3️⃣ MyClass.__init__() ◽ Then I tried something unusual. ◽ I modified __new__() to return a string instead of an object. - Result? __init__() never executed ◽ Object creation was completely manipulated ◽ Both variables ended up holding the same value ◽ Moments like these remind me why I love digging into Python internals. Every layer reveals something new. #Python #PythonProgramming #PythonInternals #ObjectOrientedProgramming #DataScience #SoftwareDevelopment #Programming #CodeNewbie #LearnToCode #Metaclasses
To view or add a comment, sign in
-
-
📅 Day 1 – Learning Python Strings 🐍 Today I started learning about strings in Python. 🧠 What is a String? A string is a sequence of characters used to store text data (e.g., "welcome"). 📚 What I learned: • Strings are immutable (cannot be changed after creation) • We can access characters using indexing • We can reverse a string using slicing 💻 I also tried a small program to reverse a string (added in image 👇) 🚀 Learning step by step. #Python #LearningJourney #100DaysOfCode #BeginnerDeveloper
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