✅ Day 24 of 100 — Working with Files, Directories & Paths 📂 A new skill unlocked today: file handling in Python. In this mini-project, I learned how to: - Read from and write to .txt files - Use .strip(), .replace(), and .readlines() to process content - Automate personalized letter creation The task was to take a list of names from one file and merge each into a starting_letter.txt, replacing [name] with the actual person's name—turning one template into many personalized letters in seconds. It's exciting to move beyond pure programming logic and start automating real-world tasks like mail merging. Each new concept opens another door. 🚪👨💻 #python #100DaysOfCode
Python File Handling & Automation
More Relevant Posts
-
✨ What is Flow Control? -> The foundation of programming logic — how Python decides what to run and when to run it. 🔹 The if Statement Your first decision-making tool. Run a block of code only when a condition is True. Simple, Powerful. 🔹 The if-else Statement Two paths. One outcome. Perfect for binary decisions like Pass/Fail, Login/Logout, Yes/No. 🔹 The if-elif-else Statement The real workhorse. Handle multiple conditions in a clean, readable sequence — like a grade calculator or a weather classifier. 🔹 A Complete Python Program See all three statements working together in one real example — with inputs, logic, and output explained step by step.
To view or add a comment, sign in
-
🚀 Mini Project: Expense Tracker (Python Console Application) I’m excited to share my mini project — a simple Expense Tracker built using Python in VS Code. 🔹 This is a menu-driven console application that allows users to: • Add daily expenses (Date, Category, Description, Amount) • View all recorded expenses • Calculate total expenses • Exit the program safely This project helped me strengthen my understanding of Python fundamentals and improve my logical thinking while building a real-world problem-solving application. 🎯 Tools Used: Python VS Code Looking forward to feedback and suggestions to improve it further! 😊 #Python #BeginnerProject #CodingJourney #VSCode #LearningByDoing #MiniProject
To view or add a comment, sign in
-
I wasted months writing loops that Python already solved for me. Only later did I realize how much power is packed into Python’s built-in functions. These 10 built-ins quietly make your code: • shorter • clearer • easier to maintain 🔹 len() → count items 🔹 zip() → combine iterables 🔹 map() → apply logic 🔹 filter() → filter data 🔹 any() → check if any True 🔹 all() → check if all True 🔹 sum() → add elements 🔹 sorted() → sort values 🔹 enumerate() → index + value 🔹 range() → generate numbers If you’re learning Python: 👉 Save this 👉 Use one today 👉 Replace a loop Which one helped you the most? #Python #PythonTips #Programming #PythonDeveloper #SoftwareEngineer
To view or add a comment, sign in
-
-
🚀 Want more “Pythonic” code in 5 minutes? These little tricks are not magic. They are tiny shortcuts that make your code cleaner, faster to read and easier to maintain If you write Python daily, keep this cheat sheet nearby ⏱️ 1: List comprehensions — build lists fast, clean, and Pythonic [...] 2: zip() — pair lists by index, no manual loops zip(names, ages) 🔗 3: Unpacking — swap and split values in one step a, b = b, a 🔁 4: *args and **kwargs — flexible functions that accept any inputs def f(*args, 5: **kwargs) 🧩 enumerate() — loop with index without extra counters enumerate(items) 🧠 #Python #Programming #CodingTips #Developer #CleanCode #LearnPython #DevCommunity
To view or add a comment, sign in
-
-
A circular reference happens when two or more objects reference each to other. For example: list A contains a reference to list B and B contains ref back to list A. This creates a cycle. The problem is that Python mainly uses reference counting to delete Objects. An object is removed only when it's reference count becomes 0. In a circular reference, each object still has at least one reference form the other, so their reference count never reaches 0, and they are automatically deleted. This can cause memory to stay used longer than needed. How can python delete this circular reference ? the solution is Python's Garbage collector (GC). It can delect groups of objects that are no longer reachable from the program, even if they reference each other, and it removes them to free memory very simple example : import GC a = [] b = [] a.append(b) b.append(a) del a del b GC.collect() #python #garbageCollector #(GC) #dev #deeplearning #programmation #pythonDev
To view or add a comment, sign in
-
-
Why does Python sometimes need an __init__.py file (even when it’s empty)❔ __init__.py tells Python: “This folder is a package.” Before Python 3.3, imports failed without it. Even today, it’s useful for: 1. Explicit package boundaries 2. Package-level initialization 3. Clean public APIs 4. Better tool & framework compatibility Example: ➡️ Folder structure utils/ ├── __init__.py └── helpers.py ➡️ helpers.py file def greet(): return "Hello Ansh!" Now, ➡️ from utils.helpers import greet (this works because "utils" is a package) Rule of thumb: If you want clarity, control, and fewer surprises 😊 keep __init__.py. Visit: https://lnkd.in/dknCdk6i Thankyou. #Python #Programming #SoftwareEngineering #Backend #Learning
To view or add a comment, sign in
-
-
Python Loops Made Simple! 🔄🐍 Why repeat yourself when you can automate? Python loops are the secret to writing efficient code in fewer lines. 1. FOR Loop (The Iterator) Use this when you want to go through a list or a fixed range. Example: for i in range(3): print("Python is fun!") (This will print the message 3 times) 2. WHILE Loop (The Condition Keeper) Use this when you want to keep running as long as a condition is True. Example: count = 1 while count <= 3: print("Loading...") count += 1 (Repeats until count reaches 3) Automation starts with mastering these two! 💻✨ Which one do you use most? Let me know in the comments! 👇 #Python #Coding #Programming #Automation #TechTips #LearnToCode #anshulyadav45
To view or add a comment, sign in
-
-
Installed the latest Python version today and learned more than I expected. What looked like a simple upgrade turned into a real debugging session: • Removed older versions installed via Scoop • Fixed PATH conflicts • Resolved broken pip launcher errors • Cleaned up legacy Python entries • Reconfigured environment variables properly At one point, python and py were pointing to different versions. Then pip started throwing launcher errors referencing an uninstalled Python312 path. Instead of reinstalling everything blindly, I traced it using: where python where pip python -m pip --version Step by step, I fixed the environment and finally got: Python 3.14.3 pip 26.0.1 Working cleanly and correctly. Small reminder: Being a developer is not just about writing code. It is about understanding how your tools actually work under the hood. Today was not about Python. It was about problem solving. #Python #DeveloperJourney #Debugging #Learning #Programming #ProgrammingTools
To view or add a comment, sign in
-
-
I’ll admit it: early in my Python journey, I spent hours debugging code that looked fine. Functions returning the wrong value, variables mysteriously “disappearing,” and weird side effects… all because I didn’t fully understand Python variable scope. Once I got it, my code became cleaner, easier to debug, and way more predictable. I turned that hard-earned lesson into a short, practical guide that walks you through local, global, and nonlocal variables with real examples. 👉 Check it out here: https://lnkd.in/djp6HJdD If you’re serious about improving your Python fundamentals, this guide is a simple way to save hours of frustration. #Python #LearnPython #CodingTips
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