<?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 Charan on Medium]]></title>
        <description><![CDATA[Stories by Charan on Medium]]></description>
        <link>https://medium.com/@saicharan.dasari09?source=rss-b6f86373fb35------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*fKtYWCIYE4-s9tm2Vzpf9g@2x.jpeg</url>
            <title>Stories by Charan on Medium</title>
            <link>https://medium.com/@saicharan.dasari09?source=rss-b6f86373fb35------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 07:43:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@saicharan.dasari09/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[Debugging Made Easy with the icecream Library in Python]]></title>
            <link>https://medium.com/@saicharan.dasari09/debugging-made-easy-with-the-icecream-library-in-python-6bca9337088b?source=rss-b6f86373fb35------2</link>
            <guid isPermaLink="false">https://medium.com/p/6bca9337088b</guid>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Charan]]></dc:creator>
            <pubDate>Mon, 03 Feb 2025 09:52:01 GMT</pubDate>
            <atom:updated>2025-02-03T10:54:54.441Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/382/0*tGitQ-VkFbAOXd4O" /></figure><p>Debugging is a crucial part of coding. Many developers rely on print() statements to track variables and execution flow. But wouldn’t it be great if there were a smarter, more efficient way?</p><p>Enter icecream, a Python library that enhances debugging with better visibility and structured output.</p><p>Why icecream?</p><p>Unlike regular print() statements, icecream:</p><p>✅ Displays variable names &amp; values</p><p>✅ Shows file names and line numbers</p><p>✅ Works inside functions and expressions</p><p>✅ Requires minimal code changes</p><p>Let’s dive in and see it in action!</p><p><strong>Installing icecream</strong></p><p>To install icecream, simply run:</p><pre>pip install icecream</pre><p>This lightweight library is quick to set up and can be integrated into any Python project.</p><p>Basic Usage:</p><p>Here’s a simple example to demonstrate the difference between print() and icecream:</p><pre>from icecream import ic<br><br>def add(a,b):<br>    return a+b<br><br>print(add(5,6))<br>ic(add(5,6))</pre><p>Output:</p><pre>11<br>ic| add(5,6): 11</pre><p>✅ Shows the expression (a + b) and its result (11)</p><p>✅ No need to manually write “Sum is: …”</p><p><strong>Comparison:</strong> print() vs ic()</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/1*rOZ1sru338p4XcvRTgnTcA.png" /></figure><h4>Using icecream in Functions:</h4><p>Let’s see how icecream works inside functions:</p><pre>def add(x, y):<br>  result = x + y<br>  ic(result)<br>  return result<br><br>add(5, 7)</pre><p>Output:</p><pre>ic| result: 12</pre><p>✅ Clearly shows function output without extra print statements</p><p><strong>Tracking Execution Flow</strong></p><p>When debugging larger projects, it’s important to track execution. icecream automatically displays the file name and line number where it was called.</p><pre>ic(&quot;Debugging in progress!&quot;)</pre><p>Output:</p><pre>ic| example.py:5 in &lt;module&gt;: &#39;Debugging in progress!&#39;</pre><p>This tells you exactly where the log is coming from, saving valuable debugging time!</p><p><strong>Final Thoughts</strong></p><p>The icecream library is a must-have for Python developers. It makes debugging easier, more readable, and efficient. Next time you reach for print(), try ic() instead – you’ll love the difference!</p><p><strong>Summary:</strong> Why Use icecream?</p><p>✅ Saves time when debugging</p><p>✅ Shows expressions and their values</p><p>✅ Works in functions, loops, and large projects</p><p>✅ Includes file name &amp; line number automatically</p><p>📌 Have you used icecream before? Let me know your thoughts in the comments! 🚀</p><p>If this post was helpful, let me know! Should I cover other Python debugging tools in my next post?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6bca9337088b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>