Day 5 of #30DaysOfPython ✅ Today I met two of Python's most powerful data structures. One of them already feels like home. The other? Slightly chaotic. Lists and dictionaries. Day 5. Lists made sense quickly — they're just ordered collections. I can store things, loop through them, sort them, slice them. Intuitive. Dictionaries? At first, the key-value pair concept felt abstract. The bug that got me today? I threw both strings and integers into the same list and tried to sort it. Python did not appreciate that. TypeError showed up like an old enemy. Day 5 done. 25 more to go! 👇 Lists vs dictionaries — when do you reach for one over the other? #Python #30DaysOfPython #DataStructures #StudentLife #AIML
Lists vs Dictionaries in Python: Day 5 of #30DaysOfPython
More Relevant Posts
-
Most implementations of the State pattern in Python look very “clean”. Lots of small classes. A base interface. One class per state. But if you’ve ever worked with one in a real project, you know the downside: transitions are scattered, behaviour is hard to see in one place, and adding new states often means touching multiple files. In today’s video, I rebuild the State pattern in a very different way. Instead of relying on inheritance, I make the state machine explicit as data and use decorators to define transitions. The result is a small, reusable engine where the entire flow becomes visible at a glance. If you’re interested in writing Python that’s easier to reason about and extend, this is a pattern worth understanding. 👉 Watch here: https://lnkd.in/eg22yEHR. #python #softwaredesign #designpatterns #statemachine #cleancode
To view or add a comment, sign in
-
-
Most implementations of the State pattern in Python look very “clean”. Lots of small classes. A base interface. One class per state. But if you’ve ever worked with one in a real project, you know the downside: transitions are scattered, behaviour is hard to see in one place, and adding new states often means touching multiple files. In today’s video, I rebuild the State pattern in a very different way. Instead of relying on inheritance, I make the state machine explicit as data and use decorators to define transitions. The result is a small, reusable engine where the entire flow becomes visible at a glance. If you’re interested in writing Python that’s easier to reason about and extend, this is a pattern worth understanding. 👉 Watch here: https://lnkd.in/e9Y3xGNF. #python #softwaredesign #designpatterns #statemachine #cleancode
To view or add a comment, sign in
-
-
Day 18 revision done. Operators. If/Else. Match statements. While loops. For loops. Not just reading through notes this time actually writing the code out, making mistakes, fixing them and doing it again until it felt natural. And honestly? It's working. The things that confused me the first time around are starting to make sense now. I finally get why // and % are different. I understand why indentation is not optional in Python. I know when to use a while loop vs a for loop. Revision isn't glamorous. There's no big aha moment. It's just you sitting down, doing the work and trusting that repetition builds confidence. And slowly it is making sense It is finally sticking and guess what I'm happy. Because Python is one of the most amazing tools used in the data space and I'm out here learning it on my own. Day 19 is next. Let's keep going. #Python #100DaysOfCode #SelfTaught #GrowthMindset #DataAnalysis #W3schools
To view or add a comment, sign in
-
Ever tried to sort a list and ended up with None? The logic looks correct: nums = [3, 1, 2] sorted_nums = nums.sort() print(sorted_nums) 👉 Output: None Why did it fail? In Python, there is a big difference between a Method that modifies an object and a Function that returns a new one. 1️⃣ .sort() is a Method: It modifies the original list "in-place." It doesn't need to return anything because the work is done directly on the original variable. 2️⃣ sorted() is a Function: It creates a brand-new list and leaves the original one exactly as it was. Use .sort() when you want to save memory and don't need the original order anymore. Use sorted() when you need to keep your original data safe and want a new sorted version. #Python #30DaysOfCode #BCA #LearningInPublic #Day22 #JECRC
To view or add a comment, sign in
-
-
Recursion confused me. So I built a visualizer for it. 🐍 Most beginners (including me) struggle with one thing: "What actually happens when a function calls itself?" So I wrote a Python program that shows you — step by step, with a delay so you can actually follow it. Watch it go DOWN the stack, hit the base case, then come back UP — adding numbers on the way. 👇 What I used: → Recursion — function calling itself → time.sleep() — to slow execution down visually → Print statements — to trace every step This isn't from a tutorial. I built this because I was confused. That's the best reason to build anything. 💡 Important: Dry run your code, It helps alot. #Python #Recursion #LearningInPublic #DataAnalytics #BBA #BuildInPublic
To view or add a comment, sign in
-
Day 1 of learning NumPy. I thought it was just a faster Python list. Nope. NumPy arrays store only one data type — that's why they're blazing fast. And this blew my mind: my_list + 5 → Error my_array + 5 → Adds 5 to everything instantly No loops. No extra code. Just math. Day 1 and I'm already Cooked. #NumPy #Python
To view or add a comment, sign in
-
Day 3 of #30DaysOfPython ✅ Today Python started making decisions. So did I. 🔄 Control flow: if, elif, else, and loops (for and while). This is where code starts to *feel* like logic, not just instructions. Turns out, Python reads your if-elif chain from top to bottom and stops at the first True condition. I had my conditions backwards and everything was coming back😂 What I learned today: • elif is just a cleaner way to chain conditions • range() is weirdly intuitive once you stop fighting it • Infinite while loops are terrifying until you find the break statement • Indentation errors are my personal villain Day 3 done. Code is slowly starting to feel less like a foreign language. 👇 For loops or while loops — which do you use more day-to-day? #Python #30DaysOfPython #ControlFlow #CodeNewbie #MachineLearning
To view or add a comment, sign in
-
-
Finally moved Python & AI project from local to live! 🎈 I’ve been experimenting with Python lately and finished building a simple Personal Assistant for my morning routines and productivity. It was fun to step outside .NET and try out some new tools: ⚡ Groq : Really impressed with how fast the responses are. 🐍 Python: Getting more comfortable with the syntax every day. 🖥️ Streamlit: Made it super easy to put a clean UI on top. It’s work in progress, but you can check out V1 here: https://lnkd.in/gwyuaGZt #Python #Streamlit #PersonalProject #BuildingInPublic #WomenInCode
To view or add a comment, sign in
-
-
🅸🅽🅿🆄🆃 & 🅾🆄🆃🅿🆄🆃 🅵🆄🅽🅲🆄🆃🅸🅾🅽🆂 📦 Definition: In Python, Input is how we get data from the user into our program, and Output is how the program displays information back to the user. 🏠 Real-World Example: Think of a Vending Machine. Input: You press the buttons to tell the machine you want a "B3" (snack code). Output: The machine displays "Price: $1.50" on the screen and then drops your chips! 🍟 Without that type interaction, the machine is just a silent box of snacks. Here is how we do it in Python: 👉 input(): This function pauses the program and waits for you to type something. Python always treats input as a string by default, so if we want numbers, we will need to wrap it in an int() or float(). 👉 print(): It takes whatever is inside the parentheses and splashes it onto the screen for the world to see. #python #inputoutput #codingtips #pythonsimplified #datananalytics #learnpython
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
-
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