I recently got some time to dive deep into Python dictionary internals as part of my preparation for the Python Deep Dive series conducted by the Trivandrum Python Community. This was a great learning experience for me, as I got to understand the various design decisions behind the implementation of Python dictionaries. One particular thing that fascinated me was how collisions are handled in Python and the probing mechanism that is used. So, I wrote a blog post about the maths behind the probing equation. Feel free to check it out here: https://lnkd.in/gQ7_N6vv
Python Dictionary Internals and Collision Handling
More Relevant Posts
-
Blog post: Understanding Python Objects: Mutable vs Immutable As part of my journey learning Python at Holberton School, I wrote a blog post about one of the most important concepts in Python: mutable and immutable objects. In this article, I cover: -What id() and type() are -The difference between mutable and immutable objects -Integer caching and string interning How arguments are passed to functions https://lnkd.in/ebnEVa9Y
To view or add a comment, sign in
-
Day 32 of my python learning journey Today’s Python topic: Polymorphism🐍 Polymorphism = One name, many forms. Same function/method behaves differently based on object. Types I learned: 1. Duck Typing → If it walks like a duck and quacks like a duck, it’s a duck. Python cares about methods, not type. `def add(a, b): return a + b` works for int, str, list. 2. Method Overriding→ Child class changes parent class method. `class Dog(Animal): def sound(self): return "Bark"` 3. Method Overloading (sort of)→ Python doesn’t support true overloading, but we use default args or `*args` to handle it. 4. Operator Overloading → `+` works for numbers and strings. We can define `*add*` in our class too. Polymorphism makes code flexible and easy to extend. One interface, multiple behaviors. Special thanks to the CEO G.R NARENDRA REDDY Sir for constant guidance and motivation. #Python #OOP #Polymorphism
To view or add a comment, sign in
-
-
Bala Priya C walks beginners through recursion in Python, from the basics to real-world use cases like nested data and tree traversal. If you are learning Python and want to understand recursion clearly, this is a great starting point. Read it here:
To view or add a comment, sign in
-
Dynamic Typing in Python — Flexibility With a Responsibility Attached When you write x = 10 in Python, something specific happens under the hood that most introductory courses don’t explain: Python doesn’t create a variable called x that holds the value 10. It creates an integer object with the value 10 in memory, and then makes x a label that points to it. That distinction matters more than it first appears. Because x is just a reference — not a fixed container — you can reassign it to something of an entirely different type: x = 10 x = "barcelona" x = 3.14 Each reassignment doesn’t overwrite the previous value in the same memory location. Python creates a new object and redirects the label. The old object, now unreferenced, gets collected automatically by the garbage collector. You never have to declare a type, and you never have to free memory manually. This is dynamic typing. The type isn’t attached to the variable — it’s attached to the object the variable currently points to. You can verify this yourself with type() and id(): x = 100 print(type(x), id(x)) x = "hello" print(type(x), id(x)) The id changes with each reassignment because x is now pointing to a completely different object in memory. The flexibility this gives you is real. But so is the responsibility. In a statically typed language, the compiler catches type mismatches before the program ever runs. In Python, those mismatches surface at runtime — which means the burden of keeping track of what a variable holds at any given moment falls on you, the developer. Dynamic typing makes Python fast to write. Understanding what it’s actually doing makes you less likely to be surprised by what it does. #Python #PythonMOOC2026 #BackendDevelopment #SoftwareEngineering #LearningInPublic #UniversityOfHelsinki
To view or add a comment, sign in
-
-
Python is one of the easiest languages to start with… and one of the most powerful as you grow. In the beginning, you learn: Variables Loops Functions And things start to click quickly. But what makes Python really valuable comes next. From the fundamentals in , your learning naturally evolves: Writing code → structuring it better Using loops → writing cleaner logic with comprehensions Functions → reusable and readable code Handling errors → building safer programs And then you unlock real-world usage: Working with APIs Handling data (JSON, CSV, Pandas) Writing clean classes (OOP) Using generators and decorators That’s where Python becomes truly useful. A simple way to keep improving: Build small things Automate a task Fetch some data Process a file That’s how concepts stay with you. Python is simple to begin with, and powerful to grow with. Save this for your next revision. Follow Shivam Chaturvedi for more content on practical tech learning
To view or add a comment, sign in
-
💡 Python Learning – Handling User Input Errors Today I learned how to handle user input errors using try-except in Python. try → Runs code that may cause an error except → Handles the error and prevents the program from crashing Code Example: try: n = int(input("Enter Number\t")) if n > 0: print("Positive") elif n < 0: print("Negative") else: print("Zero") except ValueError: print("Please enter a valid number") Logic: n > 0 → Positive n < 0 → Negative else → Zero What I learned: input() takes data as a string int() converts it into a number If the input is invalid (like *), it throws an error We can handle this using try-except 📌 Key takeaway: Error handling makes programs more reliable and user-friendly. What should I learn next in Python? 🤔 #Python #DataAnalytics #LearningJourney #Coding #Seaborn #Matplotlib #Analytics #NareshDailyPost #DataAnalyst
To view or add a comment, sign in
-
🚀 Python Learning Journey – Day 5: Lists in Python 🐍 Continuing my Python journey, today I learned about Lists, one of the most useful data structures in Python 🔥 📌 Key Takeaways: ✔️ Lists can store multiple values of different data types ✔️ Lists support indexing & slicing just like strings ✔️ Lists are mutable (we can change them anytime) 💻 Basic Example: l1 = [7, 9, "siddu"] print(l1[0]) # 7 print(l1[1]) # 9 📌 List Methods I Practiced: ✔️ sort() → Sorts the list ✔️ reverse() → Reverses the list ✔️ append() → Adds element at the end ✔️ insert() → Adds element at a specific index ✔️ pop() → Removes element using index ✔️ remove() → Removes a specific value 💻 Example: l1 = [1, 8, 7, 2, 21, 15] l1.sort() l1.append(8) l1.insert(3, 8) l1.pop(2) l1.remove(21) print(l1) ✨ Slowly building my foundation in Python step by step. Consistency is key! #Day5 #PythonLearning #CodingJourney #LearnPython #ProgrammingBasics #FutureBusinessAnalys
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