Day 63 of my Python Journey 👨🏽💻 🥸: Good day guys !! This post should have came in much earlier to be honest 😅. After my python learning session for today, I had to lock in on a particular lab report which I'm submitting tomorrow and I just concluded it after long hours of writing 😤... So today’s learning session was both fun 😊 and insightful as i practiced my knowledge of python dates by building a real life digital clock 🌟 Unlike the past few projects I practiced with that just fetches and displays the current time on my IDE, This project fetches and displays the current system time in real-time. The program runs continuously using an infinite loop and updates the clock every second, just like a real digital clock ✨ Here’s a simple walkthrough of how the program works 👇🏽 ~ datetime.now() function is used to get the current date and time from the system. ~ strftime (string format) was used to format the time so it displays neatly in hours, minutes, and seconds.("%H:%M:%S") ~ The while True loop was implemented and it is main cause of the clock running indefinitely. ~ Finally time.sleep(1) pauses the program for one second, ensuring the clock updates accurately every second. After writing this, I noticed the clock keeps moving to a new line as it counts then i google searched and found out that #\r is used to move the cursor back to the beginning of the line and end="" to prevent printing on a new line, which creates a smooth live-updating clock effect in the terminal. It's incredible to see how just few lines of python code can create a digital clock that runs indefinitely like a real one 👌🏽⚡ Check to see the results below 👇🏽 #Python #LearningProgress #100DaysOfCode #BeginnerProjects #Datetime #ProgrammingJourney #BuildingInPublic #consistency
More Relevant Posts
-
🚀 Revisiting Python Fundamentals Day 7: Loops in Python In programming, we often need to repeat the same task multiple times. Instead of writing the same code again and again, Python provides loops. Loops allow a block of code to run repeatedly until a condition is met. Python mainly provides two types of loops: for loop while loop 🔹 For Loop The for loop is used when the number of iterations is known in advance. It is commonly used with the range() function. Example:- for i in range(5): print(i) Here: range(5) generates numbers from 0 to 4 The loop runs exactly 5 times i takes one value per iteration The for loop is best when you know how many times something should repeat. 🔹 range() Function The range() function generates a sequence of numbers. range(start, stop, step) Example: range(1, 10, 2) This generates: 1, 3, 5, 7, 9 🔹 While Loop The while loop is used when repetition depends on a condition. The loop continues as long as the condition is True. example:- count = 0 while count < 5: print(count) count += 1 Here: The condition is checked before every iteration The loop stops when the condition becomes False While loops are useful when the number of iterations is not known beforehand. 🔹 Loop Control Statements These statements change the normal flow of loops: break → stops the loop immediately continue → skips the current iteration pass → acts as a placeholder Example: for i in range(5): if i == 3: break print(i) #Python #Loops #PythonBasics #LearnPython #Programming
To view or add a comment, sign in
-
-
🚀 Day 1 – Python Basics | Mental Model Setup Kicked off my Python learning journey with a strong focus on foundations over shortcuts. The goal today wasn’t just syntax—it was building the right mental model to think in Python. 🎯 Outcome I can now read and write basic Python code confidently. 📌 What I covered Python syntax & indentation (Python is strict—discipline matters) Variables & core data types (int, float, string, bool) Type casting (explicit > implicit, always) Input / Output operations Comments & coding best practices (readability = scalability) 🔧 Hands-on Practice ✅ Simple calculator (operators + logic) ✅ Temperature converter (real-world math use case) ✅ String formatting exercises (clean, professional output) 💡 Key takeaway Python isn’t hard—but thinking clearly is mandatory. Once the fundamentals are solid, everything else compounds faster. Kishan Timbadiya Digbijoy Sarkar
To view or add a comment, sign in
-
🚀 Day 29/100 | #100DaysOfCode — Python Learning Journey 🐍 Today I explored two very important file handling methods in Python: 👉 tell() and seek() — and they completely changed how I think about reading files 📄➡️🧠 Here’s what I learned today 👇 🔹 tell() — Where am I in the file? tell() helps to find the current position of the cursor inside the file. It tells us exactly where Python is reading or writing from. 🔹 seek() — Let’s move the cursor With seek(), we can move the file pointer to any position we want. This means we can re-read data, skip data, or jump to a specific part of the file. 🔹 Why this matters Now I understand how Python controls from where to read and where to write in large files — which is super useful in real projects. Small concepts, but very powerful when building real applications 💡🔥 Still learning. Still showing up. One step closer every day 💪 👉 Trust the process. Keep coding. #Python #FileHandling #tell #seek #100DaysOfCode #LearningInPublic #CodingJourney #Consistency
To view or add a comment, sign in
-
🧠 Python Feature That Feels Like a Cheat Code: enumerate() Most beginners write this 👇 i = 0 for item in items: print(i, item) i += 1 But Python says… why work so hard? 😌 ✅ Pythonic Way for i, item in enumerate(items): print(i, item) 🧒 Simple Explanation Imagine numbering students in a line 🧑🎓 enumerate() gives you: ✨ the number ✨ the student at the same time 🎯 💡 Why It’s Important ✔ Cleaner code ✔ Fewer bugs ✔ More readable ✔ Very common in interviews ⚡ Bonus Tip Start counting from 1: for i, item in enumerate(items, start=1): print(i, item) ✔️ Python rewards clean thinking. ✔️ If you’re manually counting in a loop… Python already has a better way 🐍✨ #Python #PythonTips #CleanCode #LearnPython #DeveloperLife #Coding
To view or add a comment, sign in
-
-
⚠️ Python Gotcha: Defining the Same Method Twice in a Class Did you know that Python does NOT support method overloading by definition order inside a class? Consider this scenario 👇 You define the same method name twice inside a class, expecting both to exist… Only the LAST definition survives. What actually happens? Python reads the class top to bottom When it sees the second func1, it completely overwrites the first one The first method is lost and ignored No warning. No error. Just replacement. Example outcome Nirmal.func1(2, 4) Runs the second version only Output: Good Morning Result is: 6 🚨 Key Takeaways Python does not support traditional method overloading Method names inside a class must be unique If you need different behaviors: Use different method names Or use default parameters / *args / conditional logic 🧠 Pro Tip If your logic seems to “mysteriously change” — check whether a method name was accidentally redefined. Learning these small details makes a big difference in writing clean, predictable Python code 🐍 #Python #OOP #ProgrammingTips #LearningPython #Developers #CodeSmart
To view or add a comment, sign in
-
-
🚀 7-Day Python Project Challenge | Day 2 Completed Day 2 of my 7-Day Python Project Challenge is officially complete — and the momentum is real 💪 ✅ Day 2 Project: QR Code Generator using Python Today, I built a Python-based QR Code Generator that converts text or URLs into scannable QR codes. This project reminded me that learning becomes powerful when you actually build something. 💡 Key takeaways from Day 2: • Gained hands-on experience with Python libraries • Transformed user input into real-world output • Improved problem-solving and debugging skills • Strengthened confidence by shipping a working project This challenge is teaching me one important lesson: 👉 Progress beats perfection. Showing up every day and writing code matters more than waiting to be “ready”. Two days down, five to go. Day 3 loading… 🔥👩💻 🔗 GitHub Repository: 👉 https://lnkd.in/gnPCKVuN #7DayChallenge #Day2Completed #PythonProjects #LearningByDoing #Consistency #SelfLearning #QRCodeGenerator
To view or add a comment, sign in
-
🐍 Day 12 of my Python Full-Stack Journey — Mastering Lists! Today I went deep into one of Python's most powerful built-in data structures: Lists. Here's what I covered: ✅ Creating and indexing lists ✅ Slicing (list[1:4], negative indexing) ✅ List methods — append(), extend(), insert(), remove(), pop(), sort(), reverse() ✅ List comprehensions (honestly a game-changer 🤯) ✅ Nested lists and iterating with loops The "aha moment" today? List comprehensions. Instead of writing 4 lines to filter a list, you can do it in ONE: squares = [x**2 for x in range(10) if x % 2 == 0] Clean. Pythonic. Beautiful. 🧠 Lists feel simple at first — but understanding how they work under the hood (mutability, references, shallow vs. deep copy) is where real Python thinking begins. 12 days in. The foundation is getting solid. Drop a 💬 if you're also learning Python — would love to connect and grow together! #Python #100DaysOfCode #FullStackDeveloper #LearningInPublic #PythonJourney #CodeNewbie #SoftwareDevelopment
To view or add a comment, sign in
-
-
🚀 Day 12/30 – Python OOPs Challenge 💡 Types of Inheritance in Python Yesterday we learned what Inheritance is. Today let’s see the different types of inheritance in Python. 🔹 1️⃣ Single Inheritance One child class inherits from one parent class. ``` class Parent: def show(self): print("Parent class") class Child(Parent): pass c = Child() c.show() ``` 🔹 2️⃣ Multiple Inheritance One child class inherits from more than one parent class. ``` class Father: def skill1(self): print("Gardening") class Mother: def skill2(self): print("Cooking") class Child(Father, Mother): pass c = Child() c.skill1() c.skill2() ``` 🔹 3️⃣ Multilevel Inheritance Inheritance chain (Grandparent → Parent → Child) ``` class Grandparent: def home(self): print("Owns a house") class Parent(Grandparent): pass class Child(Parent): pass c = Child() c.home() ``` 🔹 Other Types (Conceptually) - Hierarchical Inheritance - Hybrid Inheritance 📌 Key takeaway: Inheritance helps reuse code in different structures. 👉 Day 13: Method Overriding (coming tomorrow) 👍 Like | 💬 Comment | 🔁 Share 📍 Follow me to learn Python OOP step by step #Python #OOP #LearningInPublic #30DaysOfPython #CodingJourney
To view or add a comment, sign in
-
🚀 One Python Concept That Confused Me at First (Python Learning Journey - Day 23) There was a moment when Python suddenly felt unclear. The syntax looked fine. The code ran. But the result wasn’t what I expected. That’s when confusion kicked in. 👉 The code was correct 👉 The output was wrong 👉 My understanding was incomplete That gap mattered. 🌿 What Confusion Taught Me The concept that confused me wasn’t complex. It was subtle. Python does exactly what you tell it to do. Not what you assume it should do. That realization forced me to slow down. To read my own code carefully. To question my assumptions. Once I stopped blaming the language, things clicked. The problem wasn’t Python. It was how I was thinking. ✔️ Assumptions create bugs ✔️ Clarity removes surprises ✔️ Understanding beats memorization Confusion wasn’t a setback. It was a signal that I was learning something real. 🙌 Why It Matters Every learner hits a confusing concept. That moment decides growth. You can skip it. Or you can sit with it until it makes sense. Python rewarded patience. Once clarity arrived, confidence followed. 🔗 Now Your Turn What concept confused you the most when you were starting out? #PythonLearning #Day23 #LearningInPublic #DeveloperJourney #CodingMindset #LearningCurve
To view or add a comment, sign in
-
-
Today’s Python focus was 𝗠𝗼𝗱𝘂𝗹𝗲𝘀. I worked on understanding how Python lets you organize code into reusable files instead of writing everything in one script. 𝗪𝗵𝗮𝘁 𝗜 𝗽𝗿𝗮𝗰𝘁𝗶𝗰𝗲𝗱 𝘁𝗼𝗱𝗮𝘆: • Importing built in modules like math and calendar • Using functions from the math module such as sqrt() and ceil() • Working with the calendar module to generate month level calendars • Creating a custom module to store reusable functions • Importing and using functions from a user defined module • Separating logic into different files for better structure and readability 𝗞𝗲𝘆 𝘁𝗮𝗸𝗲𝗮𝘄𝗮𝘆𝘀: • Modules help break large programs into smaller, manageable pieces • Built in modules save time and prevent rewriting common logic • Custom modules make code reusable across multiple scripts • Organizing functions into modules improves maintainability Working with modules made it clear how real Python projects are structured. Code is written once, organized properly, and reused when needed. If you are learning Python, are you already using modules in your practice or still keeping everything in a single file? #Python #PythonLearning #PythonModules #ProgrammingBasics #LearningInPublic #DataAnalytics #Upskilling
To view or add a comment, sign in
Explore related topics
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