<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Babitha Munikrishnappa on Medium]]></title>
        <description><![CDATA[Stories by Babitha Munikrishnappa on Medium]]></description>
        <link>https://medium.com/@babithagowdam?source=rss-6fd56e3f4cd2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*CGp5YAsXooDJ72sKWRfXlQ@2x.jpeg</url>
            <title>Stories by Babitha Munikrishnappa on Medium</title>
            <link>https://medium.com/@babithagowdam?source=rss-6fd56e3f4cd2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 23:38:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@babithagowdam/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Many Faces of the Underscore in Python: A Hidden Superpower]]></title>
            <link>https://medium.com/@babithagowdam/the-many-faces-of-the-underscore-in-python-a-hidden-superpower-bea6164384e8?source=rss-6fd56e3f4cd2------2</link>
            <guid isPermaLink="false">https://medium.com/p/bea6164384e8</guid>
            <category><![CDATA[python-underscore-usage]]></category>
            <category><![CDATA[underscores-in-python]]></category>
            <dc:creator><![CDATA[Babitha Munikrishnappa]]></dc:creator>
            <pubDate>Wed, 16 Apr 2025 22:36:42 GMT</pubDate>
            <atom:updated>2025-04-16T22:36:42.289Z</atom:updated>
            <content:encoded><![CDATA[<p>Python is often praised for its readability and simplicity. But some of its most powerful features are hidden in plain sight — like the humble underscore (_). While it might look like a simple character, in Python, it has multiple uses that go beyond just naming variables.</p><p>In this post, we’ll walk through <strong>six common uses of the underscore in Python</strong> and how they can make your code cleaner, more readable, and more Pythonic.</p><h3>1. Throwaway Variables in Loops</h3><p>When you’re looping but don’t care about the loop variable, use _ as a placeholder:</p><p><strong>Example:</strong></p><p>for _ in range(3):<br> print(“Loading…”)</p><p>This tells other developers (and your future self) that the loop variable isn’t important — you’re just repeating an action.</p><h3>2. Accessing the Last Expression in Python Shell</h3><p>In the Python interactive shell (REPL), _ stores the result of the last executed expression:</p><p><strong>Example:</strong></p><blockquote><em>2 + 3<br> 5<br> _ * 10<br> 50</em></blockquote><p>Super handy when doing quick calculations or experimenting in the terminal.</p><h3>3. Single Leading Underscore (_var) for Internal Use</h3><p>When a variable or method starts with a single underscore, it’s a signal:<br> <strong>“This is for internal use only.”</strong></p><p><strong>Example:</strong></p><p>class User:<br> def <strong>init</strong>(self):<br> self._password = “secret123”</p><p>Python doesn’t enforce this like private variables in other languages, but it’s a strong naming convention developers follow.</p><h3>4. Name Mangling with Double Leading Underscore (__var)</h3><p>Using <strong>two leading underscores</strong> triggers <strong>name mangling</strong>, which helps avoid name clashes in subclasses:</p><p><strong>Example:</strong></p><p>class BankAccount:<br> def <strong>init</strong>(self):<br> self.__balance = 1000</p><p>acc = BankAccount()<br> print(acc._BankAccount__balance) # Accessing mangled name</p><p>It’s a way to “hide” attributes in object-oriented programming.</p><h3>5. Special (Magic) Methods with Double Underscore (__init__, __str__, etc.)</h3><p>If you’ve written a class, you’ve already met Python’s most famous <strong>dunder (double underscore)</strong> method: __init__.</p><p><strong>Example:</strong></p><p>class Product:<br> def <strong>init</strong>(self, name):<br> self.name = name</p><p>These dunder methods let you customize object behavior — like how it prints, compares, or integrates with built-in functions.</p><h3>6. Making Large Numbers More Readable</h3><p>Python allows you to use underscores in numeric literals to make large numbers easier to read:</p><p><strong>Example:</strong></p><p>budget = 10_000_000<br> print(budget) # 10000000</p><p>Helpful in finance, data science, or any field where you’re dealing with large numbers.</p><h3>Final Thoughts</h3><p>The underscore is more than just a placeholder — it’s a powerful part of Python’s syntax that allows you to write cleaner and more intentional code.</p><p>Once you know these patterns, you’ll start spotting them all over the place — in frameworks, libraries, and production code. So next time you see an underscore, don’t ignore it — <strong>appreciate its many faces.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bea6164384e8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop Googling This Python Error. Here’s What It Actually Means]]></title>
            <link>https://medium.com/@babithagowdam/stop-googling-this-python-error-heres-what-it-actually-means-47d5c760bfe0?source=rss-6fd56e3f4cd2------2</link>
            <guid isPermaLink="false">https://medium.com/p/47d5c760bfe0</guid>
            <dc:creator><![CDATA[Babitha Munikrishnappa]]></dc:creator>
            <pubDate>Wed, 16 Apr 2025 01:10:58 GMT</pubDate>
            <atom:updated>2025-04-16T01:10:58.705Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’ve been learning Python, chances are you’ve run into an error like this:</p><p><strong>Type Error: ‘int’ object is not iterable</strong></p><p>…and your first instinct is to copy and paste it straight into Google.</p><p>We’ve all been there.</p><p>But here’s the thing: Python errors aren’t trying to confuse you. Most of the time, they’re actually telling you *exactly* what went wrong — once you learn how to read them.</p><p>In this post, I’ll break down some of the most common Python errors in plain English, show you why they happen, and how to fix them — without the StackOverflow rabbit hole.</p><p><strong>1. Indentation Error: unexpected indent</strong></p><p><strong>What’s happening: </strong><br>Python is very picky about how you space your code. If your indentation (tabs/spaces) is off by even one space, it’ll throw a tantrum.</p><p><strong>Why it happens:</strong><br>You probably added an extra space or tab somewhere by accident. Or you mixed tabs and spaces — which Python really hates.</p><p><strong>How to fix it:</strong><br>- Always use 4 spaces (never tabs).<br>- Let your code editor auto-indent for you.<br>- Use a linter like black or autopep8 to keep your code clean.</p><p><strong>2. TypeError: ‘int’ object is not iterable</strong></p><p><strong>What’s happening:</strong><br>You’re trying to loop through a number like it’s a list or string.</p><p><strong>Example:</strong><br>python<br>for i in 10:<br> print(i)</p><p><strong>Fix:</strong><br>Use range() to turn that number into something Python can loop over:</p><p>python<br>for i in range(10):<br> print(i)</p><p><strong>3. NameError: name ‘x’ is not defined</strong></p><p><strong>What’s happening:</strong><br>Python has no idea what x is because it hasn’t seen it yet.</p><p><strong>Why it happens:</strong><br>You either misspelled the variable or tried to use it before assigning a value.</p><p><strong>Fix:</strong><br>Make sure the variable is defined before you use it.</p><p>python<br>score = 100<br>print(score) # Works!</p><p>4. <strong>AttributeError: ‘list’ object has no attribute ‘split’</strong></p><p><strong>What’s happening:<br></strong>You’re using a method that doesn’t exist for that object.</p><p><strong>Common mistake:</strong><br>python<br>my_list = [“hello”, “world”]<br>my_list.split() # Error! Lists don’t have a .split() method</p><p><strong>Fix:</strong><br>Use .split() on a string instead:</p><p>python<br>text = “hello world”<br>words = text.split() # [‘hello’, ‘world’]</p><p><strong>5. ModuleNotFoundError</strong></p><p><strong>What’s happening:</strong><br>Python can’t find the module you’re trying to use.</p><p><strong>Why it happens:</strong><br>- You didn’t install it yet.<br>- You misspelled the name.<br>- It’s not in your current environment.</p><p><strong>Fix:</strong><br>Open your terminal and run:</p><p><strong>bash</strong><br>pip install module-name</p><p>Okay, but what if it’s still not working?</p><p>Here’s how to debug without spiraling:</p><p>Read the full error message<br> Don’t just stop at the first line — the real info is usually at the bottom.<br> <br><strong>Use print() or type()</strong> to see what your variables actually are. <br> You might be trying to loop through a number or calling a method on the wrong data type.<br> <br><strong>Break your code into small pieces.</strong> <br> Run one part at a time to narrow down where things go wrong.<br> <br><strong> Ask yourself: </strong><br> “What is Python expecting here, and what did I give it instead?”</p><p><strong>Final Thoughts</strong></p><p>Errors are annoying — no question. But once you start reading them instead of fearing them, they become one of the best teachers in programming.</p><p>So next time you hit an error, don’t just copy-paste it into Google. Try to understand it. Python’s not mad at you — it’s just trying to help you out.</p><p><strong>Got an error that keeps haunting you? Drop it in the comments. I’ll help you figure it out.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47d5c760bfe0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What If My Dog Could Text Me? I Built It With Python]]></title>
            <link>https://medium.com/@babithagowdam/what-if-my-dog-could-text-me-i-built-it-with-python-e93e1c2754d8?source=rss-6fd56e3f4cd2------2</link>
            <guid isPermaLink="false">https://medium.com/p/e93e1c2754d8</guid>
            <dc:creator><![CDATA[Babitha Munikrishnappa]]></dc:creator>
            <pubDate>Thu, 10 Apr 2025 06:02:38 GMT</pubDate>
            <atom:updated>2025-04-10T06:02:38.378Z</atom:updated>
            <content:encoded><![CDATA[<p>Because my dog, <strong>Coffee</strong>, stays with my parents while I live abroad, sometimes I just need to know when he’s waiting by the door (or barking at absolutely nothing again). So, I decided to make a fun little project where Coffee can text me when he’s near the door!</p><h3>Meet Coffee</h3><p>I live abroad, and while I’m working here, my dog, Coffee, lives with my parents back home. He’s fluffy, a little dramatic, and absolutely loves attention. He has a ton of “skills” — like giving me the side-eye, barking at birds, and somehow always knowing when it’s snack time.</p><p>But there’s one thing he couldn’t do… text me when he’s waiting by the door. So, I had an idea: <em>What if Coffee could just text me when he’s by the door?</em></p><h3>The Idea</h3><p>It started as a joke, but I thought, <em>“Why not try it?”</em> So, I built a Python script and set up a webcam to watch for Coffee near the door. If he’s there, the script sends me a text to let me know.</p><h3>How It Works</h3><p><strong>Watching for Movement</strong>: I set up a webcam to keep an eye on the spot near the door where Coffee usually hangs out.</p><p><strong>Sending a Text</strong>: If the script detects movement (aka Coffee standing by the door), it triggers a text saying something like: “Hey, Coffee is at the door. Might want to check on him!”</p><h3>The Tech Behind It</h3><p>I used two simple tools to make this work:</p><ol><li><strong>OpenCV</strong>: A Python library that tracks movement with the webcam.</li><li><strong>Twilio</strong>: A service that lets you send text messages from a computer.</li></ol><p>Here’s a simplified version of how the code works:</p><ul><li>The webcam detects changes in the image. When it spots movement (like Coffee), it triggers the script.</li><li>The script then uses Twilio to send a message to my phone, saying something like: <em>“Coffee is at the door!”</em></li></ul><h3>Ideas to Expand</h3><p>This project is just the beginning! You could expand it in a few fun ways:</p><ul><li><strong>Bark Detection</strong>: Add a microphone to detect when Coffee barks!</li><li><strong>Send Photos</strong>: You could send a picture of Coffee with the text message.</li><li><strong>Use Telegram</strong>: If you live abroad like me, you can use free apps like Telegram instead of SMS texts.</li></ul><h3>Why It’s Useful Overseas</h3><p>Since I live abroad, I don’t always have access to high-tech pet monitoring devices. This simple project gave me a cost-free, creative way to keep track of Coffee’s door-side antics without buying anything extra. It’s a fun and practical way to stay connected with my furry friend — even from afar!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e93e1c2754d8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>