<?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 Satyaprakashsingh on Medium]]></title>
        <description><![CDATA[Stories by Satyaprakashsingh on Medium]]></description>
        <link>https://medium.com/@satyaprakashsingh9876?source=rss-35bd914a4824------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*bZHHoy6lfcy-_Lat.jpg</url>
            <title>Stories by Satyaprakashsingh on Medium</title>
            <link>https://medium.com/@satyaprakashsingh9876?source=rss-35bd914a4824------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 06:15:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@satyaprakashsingh9876/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[Python Quick Notes — Part 1 (Data Structures)]]></title>
            <link>https://medium.com/@satyaprakashsingh9876/python-quick-notes-part-1-data-structures-8d67e5ed04fa?source=rss-35bd914a4824------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d67e5ed04fa</guid>
            <category><![CDATA[python-dictionary-method]]></category>
            <category><![CDATA[python-set-methods]]></category>
            <category><![CDATA[python-set-operations]]></category>
            <category><![CDATA[python-list-methods]]></category>
            <category><![CDATA[python3]]></category>
            <dc:creator><![CDATA[Satyaprakashsingh]]></dc:creator>
            <pubDate>Mon, 29 Sep 2025 07:40:25 GMT</pubDate>
            <atom:updated>2025-09-29T07:40:25.118Z</atom:updated>
            <content:encoded><![CDATA[<h3>Python Quick Notes — Part 1 (Data Structures)</h3><p>1. The following are built-in data types and data structure in Python:</p><ul><li><strong>Numeric: </strong>int, float, complex</li><li><strong>Sequence Type: </strong>string,list, tuple</li><li><strong>Mapping Type: </strong>dict, orderdict</li><li><strong>Boolean: </strong>bool</li><li><strong>Set Type: </strong>set, frozenset</li><li><strong>Binary Types: </strong>bytes, bytearray, memoryview</li></ul><pre>| Type      | Symbol         | Ordered?  | Mutable?    | Homogeneous?  |<br>| --------- | -------------- | --------- | ----------- | ------------- |<br>| list      | `[]`           | Ordered   | Mutable     | Heterogeneous |<br>| tuple     | `()`           | Ordered   | Immutable   | Heterogeneous |<br>| set       | `set()` `{}`   | Unordered | Mutable     | Heterogeneous |<br>| dict      | `{}`           | Unordered | Mutable     | Heterogeneous |</pre><h3>List method</h3><p># len(list), min(list) and max(list), sum(lis)</p><p><strong>index(element, start, end) </strong>: This function returns the<strong> index of </strong>first occurrence of element after startand before end.</p><p>We can add elements to a list using the following methods:</p><ul><li><strong>append(): </strong>Adds an element at the end of the list.</li><li><strong>extend(): </strong>Adds multiple elements to the end of the list.</li><li><strong>insert():</strong> Adds an element at a specific position.</li><li><strong>clear():</strong> removes all items.</li></ul><p>We can remove elements from a list using:</p><ul><li><strong>remove(): </strong>Removes the first occurrence of an element.</li><li><strong>pop(): </strong>Removes the element at a specific index or the last element if no index is specified.</li><li><strong>del statement:</strong> Deletes an element at a specified index.</li></ul><h3>Python Tuple Methods</h3><pre>tuple.count(element) <br>tuple.index(element, start, end)<br># Reversing the Tuple<br>print(tup[::-1])</pre><p>Since tuples are immutable, we cannot delete individual elements of a tuple. However, we can delete an entire tuple using del, del tuple</p><h3>Tuple Unpacking with Asterisk (*)</h3><p>In Python, the <strong>“ * “ </strong>operator can be used in tuple unpacking to grab multiple items into a list. This is useful when you want to extract just a few specific elements and collect the rest together</p><h3>Set</h3><p>We can add and remove elements form the set with the help of the below functions -</p><ul><li>add(): Adds a given element to a set</li><li>remove() Removes all elements from the set</li><li><strong>discard() </strong>Removes the element from the set</li><li>pop(): Returns and removes a random element from the set</li><li><strong>remove(): </strong>Removes the element from the set</li><li>Union using “|”,</li><li>Intersection using “&amp;”,</li><li>Difference using ‘-’ ,</li><li>symmetric difference using “^”.</li></ul><h3>Symmetric Difference</h3><p>The symmetric difference between two sets <strong>A</strong> and <strong>B</strong> is denoted as <strong>A Δ B and </strong>is defined as the set of elements that are in either of set but not in their intersection. Mathematically, this can be expressed as:</p><blockquote>A Δ B = (A — B) ∪ (B -A)</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/633/1*dv662BzeS2_lh-IAlH2hag.png" /><figcaption>comparison operator in set</figcaption></figure><h3>Accessing Dictionary Items</h3><p>We can access a value from a dictionary by using the <strong>key </strong>within square brackets or get() method.</p><h3>Adding and Updating Dictionary Items</h3><p>We can add new key-value pairs or update existing keys by using assignment.</p><h3>Removing Dictionary Items</h3><p>We can remove items from dictionary using the following methods:</p><ul><li>del() Removes an item by key.</li><li>pop() Removes an item by key and returns its value.</li><li>clear() Empties the dictionary.</li><li>popitem() Removes and returns the last key-value pair.</li></ul><h3>Iterating Through a Dictionary</h3><p>We can iterate over <strong>keys</strong>, <strong>values </strong>or both [using items() method] with a for loop.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d67e5ed04fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>