<?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 Kartik Ranpise on Medium]]></title>
        <description><![CDATA[Stories by Kartik Ranpise on Medium]]></description>
        <link>https://medium.com/@kartikranpise0506?source=rss-270795fad116------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*H45kLOJcUjJgrEkn</url>
            <title>Stories by Kartik Ranpise on Medium</title>
            <link>https://medium.com/@kartikranpise0506?source=rss-270795fad116------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 09:23:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kartikranpise0506/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[Operators in Python]]></title>
            <link>https://medium.com/@kartikranpise0506/operators-in-python-a0781155fb58?source=rss-270795fad116------2</link>
            <guid isPermaLink="false">https://medium.com/p/a0781155fb58</guid>
            <category><![CDATA[operators-in-python]]></category>
            <dc:creator><![CDATA[Kartik Ranpise]]></dc:creator>
            <pubDate>Mon, 31 Aug 2026 06:44:53 GMT</pubDate>
            <atom:updated>2026-08-31T06:44:53.306Z</atom:updated>
            <content:encoded><![CDATA[<p>Python Operators:</p><p>Operators are the fundamental building blocks of any Python program. They tell the Python interpreter to perform specific mathematical, logical, or relational manipulations on data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DLbkoBqKgoFe3SNCXGkCEA.png" /></figure><h3>What is an Operator?</h3><p>An <strong>operator</strong> is a special symbol or keyword that carries out a specific computation. The values or variables that the operator acts upon are called <strong>operands</strong>.</p><p>For example, in the expression A + B:</p><ul><li>+ is the <strong>Operator</strong></li><li>A and B are the <strong>Operands</strong></li></ul><h3>1. Arithmetic Operators</h3><p>Arithmetic operators are used to perform common mathematical calculations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*c3DrWjpDp-lSezgQBl2pxw.png" /></figure><h3>2. Comparison (Relational) Operators</h3><p>Comparison operators evaluate conditions by comparing values on either side. They evaluate to either True or False, making them essential for control flow decision-making.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a9dc1M07rVpoKOJsASGMuA.avif" /></figure><h3>Comparison Decision Flowchart</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/1*-yojq89xE7IuulVDx6cJjA.png" /></figure><h3>3. Logical Operators</h3><p>Logical operators combine conditional statements. Python short-circuits evaluation: if the result is determined early, remaining expressions are skipped.</p><ul><li><strong>and</strong>: Returns True only if <strong>both</strong> operands are True.</li><li><strong>or</strong>: Returns True if <strong>at least one</strong> operand is True.</li><li><strong>not</strong>: Inverts the Boolean state (returns True if expression is False).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*inDCT1fb7f27o6G8ZLbjQw.png" /></figure><h3>Short-Circuit Logic Flowchart</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/1*-yojq89xE7IuulVDx6cJjA.png" /></figure><h3>4. Assignment Operators</h3><p>Assignment operators write or update variable values. Augmented assignment operators perform an operation and reassign the value in one step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/1*9kskvQ0wy4s45pdWO5lbBw.png" /></figure><h3>5. Identity(Special) &amp; Membership Operators</h3><p>These special operators check memory management and collection lookups.</p><h3>Identity Operators (is, is not)</h3><p>Compare memory locations (object references) using Python’s id() function, rather than structural equality.</p><p><strong>Example:</strong></p><p>a = [1, 2, 3]<br>b = [1, 2, 3]<br>c = a</p><p>print(a == b) # True (Value contents are identical)<br>print(a is b) # False (Points to different objects in memory)<br>print(a is c) # True (Points to the exact same object in memory)</p><h3>Membership Operators (in, not in)</h3><p>Tests whether a sequence (strings, lists, tuples, sets, dictionaries) contains a given element.</p><p><strong>Example:</strong></p><p>fruits = [“apple”, “banana”, “cherry”]</p><p>print(“banana” in fruits) # Returns True<br>print(“mango” not in fruits) # Returns True</p><h3>Operator Precedence (Order of Operations)</h3><p>When an expression contains multiple operators, Python follows precedence rules (like PEMDAS in algebra) to decide evaluation order:</p><ol><li><strong>Parentheses</strong>: ()</li><li><strong>Exponentiation</strong>: **</li><li><strong>Unary Operators</strong>: +x, -x, ~x</li><li><strong>Multiplication/Division</strong>: *, /, //, %</li><li><strong>Addition/Subtraction</strong>: +, -</li><li><strong>Bitwise Shifts</strong>: &lt;&lt;, &gt;&gt;</li><li><strong>Bitwise AND/OR/XOR</strong>: &amp;, ^, |</li><li><strong>Comparisons &amp; Identity/Membership</strong>: ==, !=, &lt;, &gt;, is, in</li><li><strong>Logical Operators</strong>: not, and, or</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a0781155fb58" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>