om lathiya’s Post

🚀 Post #351 — Learning Python the Right Way Most people can write this in Python: a = 10 But when I asked where does a actually live in memory? Silence. That’s the gap between using Python and understanding Python. 🧠 In Python, variables don’t store values. They store references to objects. a = 10 print(id(a)) 🔍 id() gives you the memory address (identity) of the object a points to. Why this matters in real systems 👇 • Explains immutability (int, str, tuple) • Prevents bugs in shared references & mutability • Helps debug weird behavior in lists, dicts, function calls • Builds a strong base for performance + memory reasoning Example that changes how you think: a = 10 b = 10 print(id(a) == id(b)) # True (integer caching) Python is doing memory optimization, not magic. If you skip internals like this, you’ll write code — but you won’t reason about it. Curiosity at the memory level is what separates script writers from engineers. 🐍 #Python #SoftwareEngineering #BackendDevelopment #LearningInPublic #ComputerScience

  • graphical user interface, text, application

To view or add a comment, sign in

Explore content categories