🐍 Python Trick — Did you get it right? b = a doesn't copy the list. It points to the SAME object in memory. So when b changes... a changes too. 🤯 This one gotcha has caused more bugs than most people admit. 💡 Always use b = a.copy() or b = a[:] when you need a true copy. Drop a ✅ if you got it right or a ❌ if it surprised you! Follow for more Python tricks, AI/LLM tips & SQE insights every week. 🔔 #Python #PythonTricks #SoftwareEngineering #SQE #Coding #100DaysOfCode #AIEngineering #TechLinkedIn #PythonDeveloper
Python Copying Lists Gotcha: Use a.copy() or a[:]
More Relevant Posts
-
‼️FREE SERIES ALERT Part 4: Implementing Logistic Regression From Scratch in Python | Full Beginner to Advanced AI https://lnkd.in/gujY-KVN This series is designed for beginners in AI/ML who want to move beyond "black-box" libraries and truly understand the software architecture expected in tech interviews. If you're preparing for ML roles and want to truly understand how algorithms work under the hood, this series is for you.
To view or add a comment, sign in
-
Hey folks, built a tool that generates videos from code files. Curious do you think there's a place for a video like this when all you care about is the learning or do you always prefer a human talking head? Let me know in the comments :) #ai #video #education #discuss #python
To view or add a comment, sign in
-
🚀 Day 5 of My Generative & Agentic AI Journey! Today’s focus was on understanding Tuples in Python and how they work. Here’s what I learned: 🔗 Tuples in Python: • Tuples are denoted using () brackets • They are immutable — once created, they cannot be changed • Useful for storing fixed data 🔄 Swapping Values: • Learned a very clean Python trick to swap values • Example: A, B = 2, 1 • Swap using: A, B = B, A 🔍 Checking Elements: • Used the “in” keyword to check if an element exists in a tuple 👉 Key takeaway: Tuples are simple, efficient, and useful when you don’t want your data to change. Slowly building strong Python fundamentals step by step 💪 #Day5 #Python #GenerativeAI #AgenticAI #LearningJourney #BuildInPublic
To view or add a comment, sign in
-
Wrote a very simple Python script today to pull in a few dozen businesses in one specific region and one specific industry. Shocking how much easier this is now as compared to 10-15 years ago. For all that AI concerns me, making the debugging process easier? I like that, a lot.
To view or add a comment, sign in
-
If Python feels inconsistent… you’re probably missing this. Day 15 — Polymorphism & Method Overloading Quick recap: Explored how the same method can behave differently based on context. Here’s what clicked: → Polymorphism isn’t theory — it’s flexibility in design One interface, multiple behaviors = cleaner, scalable code → Python doesn’t support traditional method overloading But it simulates it using default arguments & dynamic typing → Real power = writing code that adapts without rewriting logic The struggle? I kept trying to force Java-style overloading. Didn’t work. Breakthrough came when I stopped fighting Python… and started thinking in Pythonic design patterns. That shift changes everything. Showing up daily. No skips. No shortcuts. If you’re building real skills, consistency > intensity. What confused you the most about polymorphism? Or what should I break down next?
To view or add a comment, sign in
-
-
Python is the world's number one language for AI. It's also how most teams accidentally build their worst technical debt. We've reviewed 50+ Python codebases. The same 4 mistakes appear every time. Swipe to see what to fix before your codebase becomes a liability. → Mistake 1: No type hints → Mistake 2: Notebooks in production → Mistake 3: Unpinned dependencies → Mistake 4: Sync where you need async The best Python codebases we've worked on share one thing: They were written as if the team expected it to still be running in 5 years. Type hints. Tested modules. Pinned deps. Async where it matters. That discipline is the difference between a Python product and a Python project. Bacancy builds Python systems that scale. DM us if you're inheriting one that doesn't. #Python #PythonDevelopment #CleanCode #TechnicalDebt #SoftwareEngineering #BackendDevelopment #EngineeringLeadership #HirePythonDevelopers
To view or add a comment, sign in
-
Every tutorial, every YouTube video, every “Build your first AI app” article starts with pip install. That creates a false impression — that Python isn't just popular, but required to build with AI. It isn’t. Here is my article bursting the Myths around AI, Python and Java https://lnkd.in/g8-z9tZN
To view or add a comment, sign in
-
-
Day 37 / #120DaysOfCode – LeetCode Challenge ✅ Problem Solved: • Search a 2D Matrix 💻 Language: Python 📚 Key Learnings: • Applied Binary Search on a 2D matrix • Learned how to treat matrix as a flattened sorted array • Practiced converting 1D index → 2D index (row, col) • Improved understanding of search space reduction • Strengthened logarithmic time complexity (O(log n)) thinking Better logic → Faster execution 🚀 🔗 LeetCode Profile: https://lnkd.in/gbeMKcv5 #LeetCode #Python #DSA #BinarySearch #Algorithms #CodingJourney #Consistency #120DaysOfCode
To view or add a comment, sign in
-
-
Python Series — Day 3 🧠 Let’s level it up a bit 👇 What will be the output of this code? def modify_list(lst): lst.append(4) a = [1, 2, 3] modify_list(a) print(a) Options: A. [1, 2, 3] B. [1, 2, 3, 4] C. Error D. None Think carefully 👀 (Hint: It’s not about functions… it’s about how Python handles data) Drop your answer 👇 Answer tomorrow 🚀 #Python #CodingChallenge #LearningInPublic #DataEngineering #Tech
To view or add a comment, sign in
-
-
Python descriptors are more than just a technical detail — they’re the foundation of how attributes behave in your code. By defining __get__, __set__, and __delete__, descriptors give developers precise control over property access, method binding, and class-level behavior. Mastering descriptors means moving beyond syntax into true design power. Whether you’re building scalable systems or refining elegant code, understanding descriptors unlocks a deeper level of Python fluency. At IT Learning AI, we simplify complex concepts into actionable knowledge so you can accelerate your tech journey with confidence. 👉 Learn more and start mastering Python today at itlearning.ai #itlearningai #pythonprogramming #learnpython #codewithconfidence #pythontips #pythondescriptors #techjourney #developergrowth #codesmarter #aceyourtechjourney #codingmadesimple
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