Day 4 / 100 🚀 Today I learned a small detail that makes a big difference in Python: nums[:] (in-place slicing) At first, I thought both were the same: nums = new_list nums[:] = new_list But they are NOT the same. 💡 Key difference: • nums = new_list → creates a new reference • nums[:] = new_list → updates the same list in-place Why it matters: In problems like LeetCode, we are required to modify the original array, not create a new one. This small syntax helps us follow constraints correctly. 🔑 Lesson: Sometimes, tiny details decide whether your solution is correct or not. #100DaysOfCode #Python #DSA #Learning #CodingInterview
Python In-Place Slicing with nums[:] for LeetCode
More Relevant Posts
-
💻 Day 4 of #100DaysOfCode Today I learned about Tuples, Sets, and Dictionaries in Python 🐍 What I covered: - Tuples and their properties - Sets and how they store unique values - Dictionaries (key-value pairs) - Difference between Lists, Tuples, and Sets I also practiced small programs to understand how each data structure works in real scenarios. This helped me understand where to use each one and how data can be stored in different ways. Learning step by step and improving daily 💪 See you all tomorrow with new learnings and more progress 🚀 #Python #100DaysOfCode #CodingJourney #Learning #Consistency
To view or add a comment, sign in
-
Tried learning 𝒓𝒆𝒄𝒖𝒓𝒔𝒊𝒐𝒏 in Python today 🤓 At first, this line was confusing: 𝘀[-𝟭] + 𝗿𝗲𝘃𝗲𝗿𝘀𝗲_𝘀𝘁𝗿(𝘀[:-𝟭]) Step by step break kiya aur finally it clicked 💡 Basically, last character is picked and combined with the reversed remaining string. Still practicing, but this made me realize coding isn’t just about syntax — it’s about building the right way of thinking 🧠 How do you usually approach recursion problems? Any tips for beginners? 💡 #Python #Recursion #CodingJourney #LearningInPublic #WomenTech
To view or add a comment, sign in
-
-
💻 Day 18 of #100DaysOfCode Today I explored some deeper concepts in Python 🐍 What I covered: - Learned about recursive functions - Understood local and global variables - Practiced examples to see how scope works I realized that recursion requires clear thinking and proper base conditions, otherwise it can easily lead to infinite loops. Also, understanding variable scope is important to avoid unexpected behavior in programs. Focused on practicing with examples to build clarity. See you all tomorrow with new learnings and more progress 🚀 #Python #100DaysOfCode #CodingJourney #Learning #Consistency
To view or add a comment, sign in
-
🚀 Day 10/30 – Python Challenge Learning about tuples in Python today! 🐍 🔹 Key Concepts Covered: * Creating tuples * Accessing elements using index * Iterating through tuple elements using loops * Understanding immutability (tuples cannot be changed) 💻 Mini Task: Created a tuple of numbers, accessed the first element, and used a loop to display all the values. 🎯 Learning Outcome: Understood how tuples are used to store fixed collections of data and how they differ from lists. They are especially useful when data should not be modified. Building a strong foundation in data structures step by step 💪 #Python #CodingChallenge #LearningJourney #DataStructures #StudentDeveloper #Day10
To view or add a comment, sign in
-
-
Python Today’s topic: Lists & Tuples What I learned: Creating lists and tuples Accessing elements using indexing Difference between mutable and immutable data types Example: list = [1, 2, 3] tuple = (1, 2, 3) Building strong fundamentals step by step #Python #Learning #Beginner
To view or add a comment, sign in
-
🚀 Day 85 – Python + DSA Journey Today I focused on strengthening my fundamentals in Arrays and problem-solving using Python. 🔹 Topics Covered: • Array Traversal, Insertion, Deletion • Time Complexity (O(n), O(1)) • Problem-Solving Patterns 🔹 Problems Solved: ✅ Find Second Largest Element (Optimized O(n) approach) ✅ Reverse an Array (Two-pointer technique) ✅ Move Zeros to End (Efficient swapping logic) ✅ Two Sum Problem (Hashing concept) 💡 Key Learnings: • Importance of thinking in terms of patterns • Optimizing solutions without using sorting • Writing clean and efficient code for interviews Every day I’m getting better at breaking down problems and building logical solutions. 📌 Consistency is the key — one step closer to my goal every day! #Day85 #Python #DSA #CodingJourney #ProblemSolving#Learning #SoftwareDevelopment
To view or add a comment, sign in
-
#Day11 of learning Python 🐍 Today I learned about data comprehensions in Python, including list comprehension, dictionary comprehension, and set comprehension. Practiced creating lists of even and odd numbers, filtering names based on conditions, generating dictionaries from strings and lists, and even identifying prime numbers using comprehension logic. It was interesting to see how comprehensions make code more concise, readable, and efficient compared to traditional loops. Understanding comprehensions feels like a big step toward writing cleaner and more Pythonic code. Day 11 complete — 89 days to go! 🚀 #Day11 #PythonLearning #ListComprehension #DictionaryComprehension #SetComprehension #100DaysOfLearning #CodingJourney #SkillShikshya
To view or add a comment, sign in
-
Day 3 of learning Python. Didn’t jump into anything complex… just focused on understanding input and output properly. At first it looked very simple — input() and print() — but when I actually tried small programs, I realized how important this is. Especially the part where Python takes everything as string by default and we need to convert it using int() or float(). Tried a few basic programs like taking numbers from user and printing the sum. Small thing, but felt good seeing it work. Feels like I’m finally building the base properly instead of rushing. Next step → learning conditions (if-else) and writing better logic. #Python #Learning #DevOpsJourney
To view or add a comment, sign in
-
-
𝗗𝗮𝘆 𝟭 | 𝗦𝘁𝗮𝗿𝘁𝗶𝗻𝗴 𝗺𝘆 𝗣𝘆𝘁𝗵𝗼𝗻 𝗷𝗼𝘂𝗿𝗻𝗲𝘆 𝗳𝗼𝗿 𝗗𝗮𝘁𝗮 𝗔𝗻𝗮𝗹𝘆𝘀𝗶𝘀 Today was my first step into Python, and I kept the focus on understanding the basics instead of trying to learn too many things at once. 𝗧𝗼𝗽𝗶𝗰𝘀 𝗰𝗼𝘃𝗲𝗿𝗲𝗱: 💠 What Python is and why it is widely used, especially in data analysis Basic syntax and writing simple programs 💠 Understanding how Python executes code line by line I spent some time running small pieces of code just to get comfortable with the environment. Python feels quite readable, and that made the starting phase less overwhelming. Focusing on the basics at this stage is helping me build confidence for the topics ahead. #Python #DataAnalysis #LearningJourney #PythonBasics #Beginner #TechSkills
To view or add a comment, sign in
-
This one NumPy concept saved me hours of coding 👇 👉 Vectorization Earlier, I used loops for almost everything in Python. It worked… but it was slow and messy. Then I discovered this: Instead of processing data element by element, NumPy lets you operate on the entire array at once. Example: Adding 10 to every number Before (Python list): → loop through each element Now (NumPy): → one single line That’s it. This small shift leads to: - faster execution - cleaner code - better performance on large datasets The real change is in thinking: ❌ Think in loops ✅ Think in operations on data That’s when NumPy actually starts making sense. If you’re learning NumPy, focus on this concept early. #NumPy #Python #DataScience #DataEngineering #MachineLearning #CodingJourney #TechLearning
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