How do you write unlimited data into a file?
Simple — you don't decide when to stop. The user does.
Here's the trick: use an infinite while loop. Keep taking input, keep writing to the file, line after line. And when the user is done? They just type a single dot → " . " → and the loop breaks.
No counter. No predefined limit. Just pure, clean logic.
while True:
→ take input
→ check if it's a dot
→ if yes, break
→ if no, write it to the file
This is one of those patterns that looks simple but teaches you three powerful concepts at once:
Infinite loops — and how they're not always dangerous
Controlled exit — using break with a condition
File writing — with proper resource handling
Most students fear while True because they think it'll crash their program. But when you control it with a break condition, it becomes one of the most useful patterns in real-world programming.
Think about it — text editors, chat apps, command-line tools — they all use this exact pattern. Take input forever, until the user says stop.
One dot. That's all it takes.
NR Classes
Experience the Teaching Excellence with us in BCS, BCA, BCOM and Computer Engineering branch. Visit
20/05/2026
Every Data Scientist, every ML Engineer, every Analyst — they all started the same way.
Opening a file.
Not a neural network. Not a transformer model. Not a fancy API. Just a simple .csv file.
CSV — Comma Separated Values. The most basic, most universal, most underrated data format in the world. And if you can't read it with Python, nothing else matters.
Here's the thing most courses won't tell you — before you learn pandas, before you touch dataframes, you should know how Python reads a file at the raw level.
import csv → open the file → read row by row → understand the structure.
That's it. No magic. No library doing the thinking for you. Just you, the file, and a for loop.
Why does this matter?
Because in interviews, when they ask "how would you handle a corrupted CSV?" — pandas won't save you. Understanding how csv.reader() works line by line will.
Because in production, when a 2GB file breaks your memory — knowing the raw reading approach gives you control.
Because every big thing in data starts small. And this is the smallest, most powerful first step.
Master the basics. The advanced stuff becomes easy.
Every reel I post here is a small piece of a bigger picture — logic building, Python, DSA, data engineering, real interview patterns.
But here's the thing — Instagram only shows my content to people who engage. If you watch, like, share, and follow — the algorithm brings us closer. If you don't, we become strangers again.
I don't want that, and subscribe button help us to stay connected.
If even one reel of mine has made something click in your head, stay. Not for me. For your future self who'll look back and say — "that's where it all started."
This journey is better together 🤝
Recursion is important while preparing for the interview. Here is the demonstration of how we use recursion to find out GCD of a number. This is not a good technique if there is a big difference in the numbers.
Using with keyword is secure while handling third party resource like file, database, socket etc.
0, 1, 1, 2, 3, 5, 8, 13, 21...
Notice the pattern? Every number is the sum of the previous two. That's the Fibonacci Series — and it's everywhere. From sunflower petals to galaxy spirals, nature runs on this algorithm.
But here's what makes it a coding essential — this is one of the most asked problems in interviews.
The memory allocation for class and object. 5 is an object and int is a class. sus module has a getsizeof method which returns size in bytes.
14/05/2026
A Small Talk can help you in your career growth.
WA +91 9730281255
Ever wondered what those underscores actually do in Python? 🤔
In Python, how you name your variable decides who gets to access it:
🔓 name → Public — anyone can touch it
🛡️ _name → Protected — only the family (subclass) should use it
🔒 __name → Private — locked inside the class, no one else gets in
Most beginners write everything as public without even knowing they're doing it. But when you're building real-world applications, controlling access is what separates clean code from chaos.
This is Encapsulation — one of the four pillars of OOP.
Python handles it differently than Java or C++. No keywords, just underscores. Simple, but powerful.
The main job of a data engineer is to provide fresh data to the data scientist and analysts. For that we need the connection between python and MySQL or any other databases. I used MySQL here in this session.
Click here to claim your Sponsored Listing.
Location
Category
Contact the school
Telephone
Website
Address
Behind Narayan Peth Police Chowki, Shaniwar Peth
Pune
411030