Day 13/365: Tracking Daily Attendance with Dictionaries in Python 📊👨🏫 Today I worked on a simple but very practical problem in Python: updating a daily attendance record using a dictionary. 🔍 What this code does: I started with an attendance dictionary that stores how many days each student has attended so far. Then I created a today list that contains the names of students who attended class today. In this list, some names can appear more than once (for example, if the system logs multiple entries). Using a for loop, I go through each name in today and update the dictionary: attendance.get(name, 0) checks the current attendance count for that student. If the name is not already in the dictionary, it uses 0 as the default. Then I add 1 to this value and store it back in attendance[name]. In the end, print(attendance) shows the updated attendance record for all students. 💡 What I learned: How dictionaries are perfect for tracking counts or running totals for each item (like students, products, clicks, etc.). How dict.get(key, default) helps avoid errors when a key might not exist yet. How looping over a list and updating a dictionary can be used for real-world problems like: attendance systems, order frequency tracking in e‑commerce, counting events in logs or user actions. Day 13 done ✅ 352 more to go. If you have ideas like handling duplicate entries better, separating unique students per day, or generating attendance reports over a week/month, share them with me—I’d love to build on this next. #100DaysOfCode #365DaysOfCode #Python #LogicBuilding #Dictionaries #DataStructures #CodingJourney #LearnInPublic #AspiringDeveloper
Tracking Daily Attendance with Dictionaries in Python
More Relevant Posts
-
🚀 Python Learning I used to think functions were complicated… Turns out, I was just overthinking. 👨🍳 Think of this: When you order food in a restaurant, you don’t go inside the kitchen and cook it yourself. You just give an order → and the chef handles everything. 💡 That’s exactly how functions work in Python. Instead of writing the same steps again and again, you define them once… and just “call” them whenever needed. 🔹 Example: def greet(name): print("Hello", name) greet("Dhanush") greet("Ram") greet("John") 🔥 What changed for me: Before functions → messy, repetitive code After functions → clean, reusable logic ⚠️ Mistake I made: I used to write everything in one long block. That’s not coding. That’s just typing more and creating bugs. #Python #Coding #Functions #LearningJourney Frontlines EduTech (FLM) Sai Kumar Gouru
To view or add a comment, sign in
-
-
🚀 Day 68 | Python Revision (Up to Recursion) Today I focused on revising all Python concepts up to recursion 📘 🔹 What I Revised: • Basics → variables, data types, input/output • Control statements → if-else, loops • Functions → user-defined functions, arguments • Built-in functions → len(), sum(), min(), max(), etc. • String methods → strip(), split(), replace(), join() • List & Dictionary operations • Lambda functions and functional programming basics • Recursion → factorial, list flattening 💡 Key Learning: • Revision helps in connecting all concepts together • Improved clarity on when to use loops vs recursion • Strengthened understanding of problem-solving approaches 🔥 Takeaway: 👉 Strong fundamentals come from consistent revision Consistency + Revision = Confidence 🚀 #Day68 #Python #Revision #Recursion #ProblemSolving #CodingJourney #10000Coders #PythonDeveloper #SravanKumarSir
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
-
Most learners do not explore beyond Python basics… the true beauty lies within👇 Today I dived deep into the following Python concepts: 🔹 Functional programming concepts ➡️ map(), filter(), lambda 🔹 Modules and Standard Library ➡️ built-in libraries of Python that make Python awesome. ➡️ I looked further into: 📦 The random module ➡️ generation of random data, simulations, sampling 📁 The os module ➡️ file handling and operating system path management 🧠 The array module ➡️ efficient memory usage for numeric data types ✔ Regular Expressions (Re module) → pattern-based text analysis I created: ✔️ A Fake data generator(generates realistic fake user data) Link - https://lnkd.in/g69scMzy ✔️ Log Analyzer(Parsed log files using regex)- Link - https://lnkd.in/gMiN3KF9 #Python #DataAnalytics #LearningInPublic #CodingJourney
To view or add a comment, sign in
-
🚫 Most beginners use Python dictionaries WRONG… …and they don’t even realize it. When I first learned dictionaries, I thought: “It’s just key → value… easy.” But then I hit a bug that made NO sense. The truth is most people skip: A dictionary is like a smart storage system: Looks simple, right? But the REAL rule is: Keys must be IMMUTABLE (unchangeable) You CAN use: Strings → "name" Integers → 1 Floats → 1.5 Tuples → (1, 2) ❌ You CANNOT use: Lists ❌ Sets ❌ Dictionaries ❌ ⚠️ Why? Because Python needs keys that stay stable. If keys change… your data breaks. 🧠 Simple memory trick: 👉 “Keys = Locked 🔒 (immutable) 👉 Values = Flexible 🔄 (anything)” Once I understood this… Everything clicked: ✔ Cleaner code ✔ Fewer bugs ✔ Better logic If you’re learning Python, don’t just memorize… Understand WHY things work. That’s where real growth starts #Python #Coding #Programming #LearnPython #DataAnalytics #BeginnerProgrammer #TechSkills #100DaysOfCode #Developers #AI #CareerGrowth
To view or add a comment, sign in
-
-
Today was one of those Python lessons that felt less like learning code and more like learning how to read its warnings properly. 🐍 Day 15 of my #30DaysOfPython journey was all about errors, and honestly, this topic matters because every developer runs into them. When Python code fails, it gives feedback that tells us where the issue is and what kind of problem it is. Learning to understand those messages makes debugging a lot faster. Today I went through the common ones: 1. SyntaxError — when the code is written incorrectly 2. NameError — when a variable has not been defined 3. IndexError — when an index goes out of range 4. ModuleNotFoundError — when a module cannot be found 5. AttributeError — when an attribute does not exist 6. KeyError — when the wrong key is used in a dictionary 7. TypeError — when an operation is applied to the wrong data type 8. ImportError — when something is imported incorrectly 9. ValueError — when the value is valid in type, but not in meaning 10. ZeroDivisionError — when a number is divided by zero What stood out to me today was how errors are not just problems — they are clues. Once you stop panicking and start reading them properly, debugging becomes a lot less intimidating. One more day, one more topic, one more step toward writing code with less guessing and more understanding. Which error has annoyed you the most while coding so far? #Python #LearnPython #CodingJourney #30DaysOfPython #Programming #DeveloperJourney
To view or add a comment, sign in
-
DAY 2 – #LearningInPublic (Python Basics) 🧠 Today’s Focus: My First Calculation in Python ✅ Every programming journey starts with something small — today I wrote my first Python calculation using variables and addition. Here’s what I learned: 📌 Step 1: Create Variables I stored numbers inside variables: • a = 10 • b = 10 Variables act like containers that hold values. 📌 Step 2: Perform Calculation I added both variables: sum = a + b Python calculated the result and stored it in a new variable called sum. 📌 Step 3: Print Output Finally, I displayed the result using print(): Output: 20 Wow You have done your first calculation in Python 💡 Key Concepts Learned • Variables • Assignment operator (=) • Addition operator (+) • Storing results in variables • print() function • Running first Python program This may look simple, but this is the foundation of everything in Python: Data Science Machine Learning AI Automation Web Development Every advanced system starts with basic calculations like this. Small steps. Big journey ahead. 🚀 #LearningInPublic #Python #PythonBeginner #DataScience #AI #Programming #100DaysOfCode #DeveloperJourney #MachineLearning #AIEngineering
To view or add a comment, sign in
-
Today’s Python lesson felt less like learning syntax and more like learning how to stay calm when code gets messy. 🐍 Day 17 of my #30DaysOfPython journey was all about exception handling, and this one felt very real because errors are not rare — they are part of the process. Python gives us a way to handle errors without crashing the whole program. That makes code feel a lot more dependable. Today I explored: 1. try → run the risky code 2. except → handle the problem if something goes wrong 3. else → run only when no exception happens 4. finally → run no matter what I also learned about: 1. unpacking lists and tuples using *variable_name 2. unpacking dictionaries using **variable_name 3. packing values with *args and **kwargs 4. spreading values into function calls 5. enumerate() → when you need both index and value 6. zip() → when you want to loop through multiple lists together What stood out to me today was this: good code is not code that never fails — it is code that knows how to handle failure properly. One more day, one more topic, one more reminder that writing Python is also about writing with patience. Which one feels most useful in real code to you: try/except, enumerate(), or zip()? Github Link - #Python #LearnPython #CodingJourney #30DaysOfPython #Programming #DeveloperJourney
To view or add a comment, sign in
-
I recently published a beginner-friendly guide on Python Lists 🐍 From basics to advanced concepts and even real-world problems — I tried to simplify everything in one place. While learning Python, I realized one thing: 👉 Understanding lists properly makes everything easier. In this article, I covered: ✔️ Important list methods (append, sort, etc.) ✔️ Advanced concepts like slicing & list comprehension ✔️ Real-world problems with solutions If you're starting with Python, this might help you build a strong foundation. 🔗 Read here: https://lnkd.in/g_s_He5k I’ll be sharing more on: Pandas | NumPy | SQL | and simple coding concepts Let’s learn and grow together 🚀 #Python #Programming #Coding #PythonForBeginners #DataStructures
🐍 “Python Lists — Complete Beginner to Advanced Guide (With Examples)” # 🔰 Part 1: Basics medium.com To view or add a comment, sign in
-
Day 2 of #30DaysOfPython ✅ Today's lesson: Python doesn't care how you label things — until it does. I spent today learning variables and data types. Sounds basic. It is basic. But here's what I didn't expect — Python's dynamic typing actually confused me at first. In theory, I knew that x = 5 and x = "five" are both valid. In practice, I accidentally added a string to an integer and got a TypeError I didn't understand for 10 whole minutes. The bug? I was reading user input and forgetting that input() always returns a string. So my "sum" was just two numbers glued together like "510" instead of 15. 🤦 What clicked today: • int, float, str, bool — the four I'll use constantly • type() is your best friend when debugging • Python is forgiving… until you mix types Lesson of the day: Read your error messages. The answer is usually right there. Resources I used: Python.org official docs + a great freeCodeCamp YouTube video. Day 2 done. The bugs are starting early — right on schedule. 😅 👇 What's the sneakiest beginner Python bug you ever ran into? Tell me so I can be prepared! #Python #30DaysOfPython #DataTypes #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