<?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 Aswini saravanan on Medium]]></title>
        <description><![CDATA[Stories by Aswini saravanan on Medium]]></description>
        <link>https://medium.com/@aswinisaravanan2001?source=rss-9d83e1730757------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*ChSCOVo97w6heAeT</url>
            <title>Stories by Aswini saravanan on Medium</title>
            <link>https://medium.com/@aswinisaravanan2001?source=rss-9d83e1730757------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 20:25:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aswinisaravanan2001/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[Collections in Python]]></title>
            <link>https://medium.com/@aswinisaravanan2001/collections-in-python-b76b68f82733?source=rss-9d83e1730757------2</link>
            <guid isPermaLink="false">https://medium.com/p/b76b68f82733</guid>
            <dc:creator><![CDATA[Aswini saravanan]]></dc:creator>
            <pubDate>Sat, 28 May 2022 10:44:05 GMT</pubDate>
            <atom:updated>2022-05-28T10:44:05.140Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Collections</strong> in Python are containers used for storing data and are commonly known as data structures, such as lists, tuples, arrays, dictionaries, etc.</p><p>Python has a built-in collections module providing additional data structures for collections of data.</p><h3>Collection Modules</h3><p>There are 6 most commonly used data structures in the collections modules.</p><h3>1. Defaultdict</h3><p><strong>Defaultdict</strong> is exactly like a dictionary in python. The only difference is that it does not give an exception/key error when you try to access the non-existent key.</p><p>In the following code, even though the 4th index was not initialized, the compiler still returns a value, 0, when we try to access it.</p><h4>Example:</h4><p>from collections import defaultdict</p><p>nums = defaultdict(int)</p><p>nums[‘one’] = 1</p><p>nums[‘two’] = 2</p><p>nums[‘three’] = 3</p><p>print(nums[‘four’])</p><p>Run</p><h3>2. Counter</h3><p><strong>Counter</strong> is a built-in data structure which is used to count the occurrence of each value present in an array or list.</p><p>The following code is counting the number of occurrences of the value 2 in the given list.</p><h4>Example:</h4><p>from collections import Counter</p><p>list = [1,2,3,4,1,2,6,7,3,8,1,2,2]</p><p>answer=Counter()</p><p>answer = Counter(list)</p><p>print(answer[2])</p><p>Run</p><h3>3. Deque</h3><p><strong>Deque</strong> is an optimal version of list used for inserting and removing items. It can add/remove items from either start or the end of the list.</p><p>In the following code, z is being added at the end of the given list and g is at the start of the same list.</p><h4>Example:</h4><p>from collections import deque</p><p>#initialization</p><p>list = [“a”,”b”,”c”]</p><p>deq = deque(list)</p><p>print(deq)</p><p>#insertion</p><p>deq.append(“z”)</p><p>deq.appendleft(“g”)</p><p>print(deq)</p><p>#removal</p><p>deq.pop()</p><p>deq.popleft()</p><p>print(deq)</p><p>Run</p><h3>4. Namedtuple()</h3><p>The <strong>Namedtuple()</strong> solves a very major problem in the field of computer science. Usual tuples need to remember the index of each field of a tuple object, however, <strong>namedtuple()</strong> solves this by simply returning with names for each position in the tuple.</p><p>In the following code, an index is not required to print the name of a student rather passing an attribute is sufficient for the required output.</p><h4>Example:</h4><p>from collections import namedtuple</p><p>Student = namedtuple(‘Student’, ‘fname, lname, age’)</p><p>s1 = Student(‘Peter’, ‘James’, ‘13’)</p><p>print(s1.fname)</p><p>Run</p><h3>5. ChainMap</h3><p><strong>ChainMap</strong> combines a lot of dictionaries together and returns a list of dictionaries. ChainMaps basically encapsulates a lot of dictionaries into one single unit with no restriction on the number of dictionaries.</p><p>The following program ChainMap to return two dictionaries.</p><h4>Example:</h4><p>import collections</p><p>dictionary1 = { ‘a’ : 1, ‘b’ : 2 }</p><p>dictionary2 = { ‘c’ : 3, ‘b’ : 4 }</p><p>chain_Map = collections.ChainMap(dictionary1, dictionary2)</p><p>print(chain_Map.maps)</p><p>Run</p><h3>6. OrderedDict</h3><p><strong>OrderedDict</strong> is a dictionary that ensures its order is maintained. For example, if the keys are inserted in a specific order, then the order is maintained. Even if you change the value of the key later, the position will remain the same.</p><h4>Example:</h4><p>from collections import OrderedDict</p><p>order = OrderedDict()</p><p>order[‘a’] = 1</p><p>order[‘b’] = 2</p><p>order[‘c’] = 3</p><p>print(order)</p><p>#unordered dictionary</p><p>unordered=dict()</p><p>unordered[‘a’] = 1</p><p>unordered[‘b’] = 2</p><p>unordered[‘c’] = 3</p><p>print(“Default dictionary”, unordered)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b76b68f82733" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[EXCEPTIONS IN PYHTON:]]></title>
            <link>https://medium.com/@aswinisaravanan2001/exceptions-in-pyhton-8146474d8f01?source=rss-9d83e1730757------2</link>
            <guid isPermaLink="false">https://medium.com/p/8146474d8f01</guid>
            <dc:creator><![CDATA[Aswini saravanan]]></dc:creator>
            <pubDate>Thu, 19 May 2022 10:04:40 GMT</pubDate>
            <atom:updated>2022-05-19T10:04:40.321Z</atom:updated>
            <content:encoded><![CDATA[<h3>What are exceptions in Python?</h3><h4>Python has built-in exceptions which can output an error. If an error occurs while running the program, it’s called an exception.</h4><p>If an exception occurs, the type of exception is shown. Exceptions needs to be dealt with or the program will crash. To handle exceptions, the try-catch block is used.</p><p>Some exceptions you may have seen before are FileNotFoundError, ZeroDivisionError or ImportError but there are many more.</p><p>All exceptions in Python inherit from the class BaseException. If you open the Python interactive shell and type the following statement it will list all built-in exceptions:</p><pre>&gt;&gt;&gt; dir(<strong>builtins</strong>)</pre><p>The idea of the try-except clause is to handle exceptions (errors at runtime). The syntax of the try-except block is:</p><p>try:<br> &lt;do something&gt;<br>except Exception:<br> &lt;handle the error&gt;</p><p>The idea of the <em>try-except block</em> is this:</p><ul><li><strong>try</strong>: the code with the exception(s) to catch. If an exception is raised, it jumps straight into the except block.</li><li><strong>except</strong>: this code is only executed <em>if an exception occured</em> in the try block. The except block is required with a try block, even if it contains only the pass statement.</li><li>It may be combined with the <strong>else</strong> and <strong>finally</strong> keywords.</li><li><strong>else</strong>: Code in the else block is only executed if no exceptions were raised in the try block.</li><li><strong>finally</strong>: The code in the finally block is always executed, regardless of if a an exception was raised or not.</li></ul><h3>Syntax and Logical Errors</h3><p>A syntax error causes the program to terminate because the interpreter cannot interpret it. This program crashes instantly because an apostrophe is missing. The console will display the following error:</p><p>print(&#39;This <strong>is </strong>a syntax error)</p><p>^SyntaxError: EOL <strong>while sc</strong>canning string literal</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8146474d8f01" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Decorators in python]]></title>
            <link>https://medium.com/@aswinisaravanan2001/decorators-in-python-ec3d78ce40f7?source=rss-9d83e1730757------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec3d78ce40f7</guid>
            <dc:creator><![CDATA[Aswini saravanan]]></dc:creator>
            <pubDate>Thu, 19 May 2022 09:21:09 GMT</pubDate>
            <atom:updated>2022-05-19T09:24:56.691Z</atom:updated>
            <content:encoded><![CDATA[<h3>A decorator is a design pattern in Python that allows a user to add new functionality to an existing object without modifying its structure. Decorators are usually called before the definition of a function you want to decorate. In this blog, I Will show the reader how they can use decorators in their Python functions.</h3><p>Functions in Python are <a href="https://en.wikipedia.org/wiki/First-class_citizen"><strong>first class citizens</strong></a>. This means that they support operations such as being passed as an argument, returned from a function, modified, and assigned to a variable. This is a fundamental concept to understand before we delve into creating Python decorators.</p><h3>Assigning Functions to Variables</h3><p>To kick us off we create a function that will add one to a number whenever it is called. We’ll then assign the function to a variable and use this variable to call the function.</p><pre>def plus_one(number):<br>    return number + 1</pre><pre>add_one = plus_one<br>add_one(5)</pre><pre>6</pre><h3>Defining Functions Inside other Functions</h3><p>Next, we’ll illustrate how you can define a function inside another function in Python. Stay with me, we’ll soon find out how all this is relevant in creating and understanding decorators in Python.</p><pre>def plus_one(number):<br>    def add_one(number):<br>        return number + 1</pre><pre>result = add_one(number)<br>    return result<br>plus_one(4)</pre><pre>output: 5</pre><h3>Passing Functions as Arguments to other Functions</h3><p>Functions can also be passed as parameters to other functions. Let’s illustrate that below.</p><pre>def plus_one(number):<br>    return number + 1</pre><pre>def function_call(function):<br>    number_to_add = 5<br>    return function(number_to_add)</pre><pre>function_call(plus_one)</pre><pre>output: 6</pre><h3>Functions Returning other Functions</h3><p>A function can also generate another function. We’ll show that below using an example.</p><pre>def hello_function():<br>    def say_hi():<br>        return &quot;Hi&quot;<br>    return say_hi<br>hello = hello_function()<br>hello()</pre><pre>output: &#39;Hi&#39;</pre><h3>Creating Decorators</h3><p>With these prerequisites out of the way, let’s go ahead and create a simple decorator that will convert a sentence to uppercase. We do this by defining a wrapper inside an enclosed function. As you can see it very similar to the function inside another function that we created earlier.</p><pre>def uppercase_decorator(function):<br>    def wrapper():<br>        func = function()<br>        make_uppercase = func.upper()<br>        return make_uppercase</pre><pre>    return wrapper</pre><p>Our decorator function takes a function as an argument, and we shall, therefore, define a function and pass it to our decorator. We learned earlier that we could assign a function to a variable. We’ll use that trick to call our decorator function.</p><pre>def say_hi():<br>    return &#39;hello there&#39;</pre><pre>decorate = uppercase_decorator(say_hi)<br>decorate()</pre><pre>output: &#39;HELLO THERE&#39;</pre><p>However, Python provides a much easier way for us to apply decorators. We simply use the @ symbol before the function we’d like to decorate. Let’s show that in practice below.</p><pre>@uppercase_decorator<br>def say_hi():<br>    return &#39;hello there&#39;</pre><pre>say_hi()</pre><pre>output: &#39;HELLO THERE&#39;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec3d78ce40f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[polymorphism in python]]></title>
            <link>https://medium.com/@aswinisaravanan2001/polymorphism-in-python-8e0f31f4356d?source=rss-9d83e1730757------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e0f31f4356d</guid>
            <dc:creator><![CDATA[Aswini saravanan]]></dc:creator>
            <pubDate>Mon, 16 May 2022 10:05:25 GMT</pubDate>
            <atom:updated>2022-05-16T10:12:48.968Z</atom:updated>
            <content:encoded><![CDATA[<p>In polymorphism, a child class inherits all the pattern class’s methods, but in some cases, the parent class’s inherited function doesn’t fully fit with the child class. We will have to re-implement the child class method in such circumstances.</p><p>Polymorphism may be used in Python in various ways. Polymorphism can be defined using numerous <a href="https://www.simplilearn.com/tutorials/python-tutorial/python-functions">functions</a>, <a href="https://www.simplilearn.com/tutorials/python-tutorial/objects-and-classes-in-python">class methods, and objects.</a> So, let us deep-dive into each of these ways.</p><h3>Polymorphism With Function and Objects</h3><p>To induce polymorphism using a function, we need to create such a function that can take any object. Here is an example of Polymorphism using functions and objects:</p><h3>Code</h3><p>class Dog():</p><p>def animal_kingdom(self):</p><p>print(“Mammal”)</p><p>def legs(self):</p><p>print(“Four”)</p><p>class Lizard():</p><p>def animal_kingdom(self):</p><p>print(“Mammal”)</p><p>def legs(self):</p><p>print(“Four”)</p><p>def function1(obj):</p><p>obj.animal_kingdom()</p><p>obj.legs()</p><p>obj_dog = Dog()</p><p>obj_lizard = Lizard()</p><p>function1(obj_dog)</p><p>function1(obj_lizard)</p><h3>Output</h3><p>Mammal</p><p>Four</p><p>Mammal</p><p>Four</p><p>In the above example, the function, function1() takes in an object named obj, which in turn lets the functions call the methods, animal_kingdom() and legs() of both the classes, Dog and Lizard. To do this, we must create the instances of both classes.</p><p>Main Features Of Python include:</p><ul><li>Beginner-friendly Language — Python is easy to learn, maintain, implement and read. It is interactive in nature.</li><li>Object-Oriented — Python encapsulates code within objects by supporting the Object-Oriented programming approach or style or approach.</li><li>Industry-oriented — Python is extendable, portable, scalable, cross-platform friendly with a standard library, and has support for GUI applications and interactive mode.</li></ul><h3>Polymorphism With Class Methods</h3><p>Let us discuss how to implement Polymorphism in Python using Class Methods.</p><p>In the same way, Python makes use of two separate class types. For this, we design a for loop that iterates through an item tuple. After that, we need to perform method calling without regard for the class type of each object. We take it for granted that these methods have their existence in each of the classes.</p><p>A perfect example depicting Polymorphism with Class Methods using Python:</p><h3>Code</h3><p>class Car():</p><p>def wheels(self):</p><p>print(4)</p><p>def mode_of_transport(self):</p><p>print(“Private usually”)</p><p>class Bus():</p><p>def wheels(self):</p><p>print(8)</p><p>def mode_of_transport(self):</p><p>print(“Public usually”)</p><p>obj_car = Car()</p><p>obj_bus = Bus()</p><p>for vehicle in (obj_car, obj_bus):</p><p>vehicle.wheels()</p><p>vehicle.mode_of_transport()</p><h3>Output</h3><p>4</p><p>Private usually</p><p>8</p><p>Public usually</p><p>In the above example, class methods wheels(), mode_of_transport(), which belong to Car and Bus classes, are directly invoked using the instances of these two classes in the for loop, which loops through both the class methods.</p><h3>Polymorphism With Inheritance</h3><p>Polymorphism, a child class method is allowed to have the same name as the class methods in the parent class. In inheritance, the methods belonging to the parent class are passed down to the child class. It’s also possible to change a method that a child class has inherited from its parent.</p><p>This is typically used whenever a parent class inherited method is not appropriate for the child class. To rectify this situation, we use Method Overriding, which enables re-implementing of a method in a child class.</p><h3>What Is Method Overriding?</h3><p>Method overriding is an <a href="https://www.simplilearn.com/tutorials/python-tutorial/python-object-oriented-programming">object-oriented programming</a> technique that lets us change the function implementation of a parent class in the child class. Method overriding is basically a child class’s ability to implement change in any method given by one of its parent classes.</p><p>Conditions of Method Overriding:</p><ul><li>There should be inheritance. Within a class, function overriding is not possible, therefore a child class is derived from a parent class.</li><li>A function of the child class should have the same number of parameters as that of the parent class.</li></ul><p>We know that in inheritance, a child class gets access to the protected and public methods and variables of the parent class whenever it inherits it. We exploit this concept to implement Polymorphism using <a href="https://www.simplilearn.com/inheritance-in-python-article">Inheritance</a> as well.</p><p>A perfect example of Method Overriding and Polymorphism with Inheritance is:</p><h3>Code</h3><p>class Vehicle:</p><p>def desc(self):</p><p>print(“So many categories of vehicle”)</p><p>def wheels(self):</p><p>print(“Differs according to the vehicle category”)</p><p>class car(Vehicle):</p><p>def wheels(self):</p><p>print(4)</p><p>class bus(Vehicle):</p><p>def wheel(self):</p><p>print(8)</p><p>obj_vehicle = Vehicle()</p><p>obj_car = car()</p><p>obj_bus = bus()</p><p>obj_vehicle.desc()</p><p>obj_vehicle.wheels()</p><p>obj_car.desc()</p><p>obj_car.wheels()</p><p>obj_bus.desc()</p><p>obj_bus.wheels()</p><h3>Output</h3><p>So many categories of vehicle</p><p>Differs according to the vehicle category</p><p>So many categories of vehicle</p><p>4</p><p>So many categories of vehicle</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e0f31f4356d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DATA TYPES]]></title>
            <link>https://medium.com/@aswinisaravanan2001/data-types-54ac326f7e02?source=rss-9d83e1730757------2</link>
            <guid isPermaLink="false">https://medium.com/p/54ac326f7e02</guid>
            <category><![CDATA[data-types-in-python]]></category>
            <dc:creator><![CDATA[Aswini saravanan]]></dc:creator>
            <pubDate>Mon, 09 May 2022 12:42:15 GMT</pubDate>
            <atom:updated>2022-05-09T12:42:15.860Z</atom:updated>
            <content:encoded><![CDATA[<h3>Python has six standard Data Types:-</h3><ul><li>Numeric</li><li>String</li><li>List</li><li>Tuple</li><li>Set</li><li>Dictionary</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/479/1*CptHueAmIBcJpXSK0768QQ.png" /></figure><p>To check the <strong>data type</strong> of variable in Python, use the <strong>type()</strong> method. The <strong>type()</strong> is a built-in <strong>Python</strong> method that returns the class type of the argument(object) passed as a parameter. You place the variable inside a type() function, and Python returns the data type.</p><p>EXAMPLE:</p><p>L=[1,2,3,4]</p><p>print(type(l))</p><p>output:</p><p>&lt;class ‘list’&gt;</p><h3>Numeric Data Type:-</h3><p>In Python, a numeric data type represents the data that has a numeric value. The numeric value can be an integer, floating number, or even complex number. These values are defined as int, float, and complex classes in Python.</p><p>EXAMPLE:</p><pre>a = 2<br>print(a, &quot;is of type&quot;, type(a))<br>Output: 2 is of type</pre><h3>String Data Type:</h3><p>A string is a collection of one or more characters put in a single quote, double-quote, or triple quote. It is represented by an str class.</p><p>Example:-</p><pre>string1=  “hello everyone”<br>print(string1)<br>output: hello everyone</pre><h3>List data type:</h3><p>Lists are used to store multiple items in a single variable.</p><p>List items are ordered, changeable, and allow duplicate values.</p><p>List items are indexed, the first item has index [0], the second item has index [1], etc.</p><p>example:</p><p>l1=[1,2,3,4]</p><p>l2=[a,b,c,d]</p><p>print(l1+l2)</p><p>output:</p><p>[1,2,3,4, a, b,c,d]</p><h3>Tuple Data Type:-</h3><p>A tuple is defined as an ordered collection of Python objects. The only difference between tuple and list is that tuples are immutable i.e. tuples can’t be modified after it’s created. It is represented by tuple class. we can represent tuples using parentheses ( )</p><p>example:</p><p>t1=(1,2,3,4)<br>t2=(‘a’,’b’,’c’,’d’)<br>print(t1+t2)</p><p>output:</p><p>(1, 2, 3, 4, ‘a’, ‘b’, ‘c’, ‘d’)</p><h3>Dictionary:</h3><p>The dictionary is an unordered collection that contains key:value pairs separated by commas inside curly brackets. Dictionaries are optimized to retrieve values when the key is known.</p><p>The following declares a dictionary object.</p><p>Example:</p><p>capitals = {&quot;USA&quot;:&quot;Washington D.C.&quot;, &quot;France&quot;:&quot;Paris&quot;, &quot;India&quot;:&quot;New Delhi&quot;}</p><h3>SET:</h3><p>A set is <strong>a collection which is unordered, </strong>In Python sets are written with curly brackets. Duplicate values will be ignored</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=54ac326f7e02" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Object-Oriented Concepts in Python]]></title>
            <link>https://medium.com/@aswinisaravanan2001/object-oriented-concepts-in-python-2ab2b3b4945e?source=rss-9d83e1730757------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ab2b3b4945e</guid>
            <dc:creator><![CDATA[Aswini saravanan]]></dc:creator>
            <pubDate>Sun, 08 May 2022 11:34:33 GMT</pubDate>
            <atom:updated>2022-05-08T11:37:20.207Z</atom:updated>
            <content:encoded><![CDATA[<p>Object-oriented programming (OOP) is a programming pattern based on the concept of objects. Objects consist of data and methods. The object’s data are its properties, that define what it is. And the object’s methods, are its functions, that define what the object can do. The object-oriented style of programming is very popular because of its ability to map the virtual world entities i.e. our code, to real-world objects. OOPS, concepts are widely used by many popular programming languages due to the several advantages it provides.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*BGQhCvfc3BWWndMh.jpg" /></figure><ol><li>They reduce the redundancy of the code by writing clear and re-usable codes (using inheritance).</li><li>They are easier to visualize because they completely relate to real-world scenarios. For example, the concept of objects, inheritance, and abstractions, relate very closely to real-world scenarios.</li><li>Every object in oops represents a different part of the code and has its logic and data to communicate with each other. So, there are no complications in the code.</li><li>A <strong>class</strong> is used to create user-defined data structures in Python. Classes define functions, which are termed methods, that describe the behaviors and actions that an object created from a class can perform. OOPS, concepts in python majorly deal with classes and objects.</li><li>Classes make the code more manageable by avoiding complex codebases. It does so, by creating a blueprint or a design of how anything should be defined. It defines what properties or functions, any object which is derived from the class should have.</li></ol><p>A class just defines the structure of how anything should look. It does not point to anything or anyone in particular. For example, say, HUMAN is a class, which has to suppose — name, age, gender, city. It does not point to any specific HUMAN out there, but yes, it explains the properties and functions any HUMAN should have or any object of class HUMAN should have.</p><h3>How to Define a Class in Python?</h3><p>Classes in Python can be defined by the keyword class, which is followed by the name of the class and a colon.</p><p><strong>Syntax:</strong></p><pre>class Human:<br>    pass</pre><h3>Creating an Object in Class</h3><p>When we create a new object from a class, it is called <strong>instantiating an object</strong>. An object can be instantiated by the class name followed by the parentheses. We can assign the object of a class to any variable.</p><p><strong>Syntax:</strong></p><pre>x = ClassName()</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ab2b3b4945e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python break, continue, pass statements with Examples]]></title>
            <link>https://medium.com/@aswinisaravanan2001/python-break-continue-pass-statements-with-examples-3eef895effc9?source=rss-9d83e1730757------2</link>
            <guid isPermaLink="false">https://medium.com/p/3eef895effc9</guid>
            <dc:creator><![CDATA[Aswini saravanan]]></dc:creator>
            <pubDate>Thu, 05 May 2022 17:26:56 GMT</pubDate>
            <atom:updated>2022-05-05T17:26:56.387Z</atom:updated>
            <content:encoded><![CDATA[<p>You might face a situation in which you need to exit a loop completely when<br>an external condition is triggered or there may also be a situation when you want to skip a<br>part of the loop and start next execution.</p><p>Python provides break and continue statements to handle such situations and<br>to have good control on your loop. This section will discuss the break,<br>continue and pass statements available in Python.</p><p>The break Statement</p><p>The break statement in Python terminates the current loop and resumes<br>execution at the next statement. The most common use for break is when some external<br>condition is triggered requiring a hasty exit from a loop. The break statement can be used in<br>both while and for loops.<br>Example:<br>for letter in ‘Welcome’: # First Example<br>if letter == ‘c’:<br>break<br>print(‘Current Letter :’, letter)<br>var = 10 # Second Example<br>whilevar&gt; 0:<br>print(‘Current variable value :’, var)<br>var = var -1<br>ifvar == 5:<br>break<br>print “End!”<br>This will produce the following output:<br>Current Letter : W<br>Current Letter : e<br>Current Letter : l<br>Current variable value : 10<br>Current variable value : 9<br>Current variable value : 8<br>Current variable value : 7<br>Current variable value : 6<br>End!</p><p>The continue Statement:</p><p>The continue statement in Python returns the control to the beginning of the<br>while loop. The continue statement rejects all the remaining statements in the current<br>iteration of the loop and moves the control back to the top of the loop.The continue statement<br>can be used in both while and for loops.</p><p>Example:<br>for letter in ‘Welcome’: # First Example<br>if letter == ‘c’:<br>continue<br>print(‘Current Letter :’, letter)<br>var = 10 # Second Example<br>whilevar&gt; 0:<br>print(‘Current variable value :’, var)<br>var = var -1<br>ifvar == 5:<br>continue</p><p>print “End!”<br>This will produce the following output:<br>Current Letter : W<br>Current Letter : e<br>Current Letter : l<br>Current Letter : o<br>Current Letter : m<br>Current Letter : e<br>Current variable value : 10<br>Current variable value : 9<br>Current variable value : 8<br>Current variable value : 7<br>Current variable value : 6<br>Current variable value : 5<br>Current variable value : 4<br>Current variable value : 3<br>Current variable value : 2<br>Current variable value : 1<br>End!</p><p>The pass Statement</p><p>In Python programming, pass is a null statement. The difference between<br>a comment and pass statement in Python is that, while the interpreter ignores a comment<br>entirely, a pass is not ignored. However, nothing happens when a pass is executed. It results in no operation (NOP).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3eef895effc9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[APPLICATION OF PYTHON]]></title>
            <link>https://medium.com/@aswinisaravanan2001/application-of-python-d6b66fe08eec?source=rss-9d83e1730757------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6b66fe08eec</guid>
            <category><![CDATA[application-of-python]]></category>
            <dc:creator><![CDATA[Aswini saravanan]]></dc:creator>
            <pubDate>Wed, 04 May 2022 15:28:30 GMT</pubDate>
            <atom:updated>2022-05-04T15:28:30.682Z</atom:updated>
            <content:encoded><![CDATA[<p>well everyone, If you are learning python you might be wondering what can I use python for exactly well that’s a trick question to answer because there are so many applications of python, but over time I have seen that there are three main popular applications for python.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/462/1*W4GPkjwUNU6K49m_gykqpw.png" /></figure><p>Web Development</p><p>Data science</p><p>Machine learning</p><h3><strong><em>A)Web Development:</em></strong></h3><p><strong>Web development</strong> is the building and maintenance of websites; it’s the work that happens behind the scenes to make a website look great</p><p>web frameworks like Django and flask are becoming very popular for web development. This framework helps you to create server-side code &lt;-&gt; front-end code. using a web framework helps you build common login, map URLs to python code, deal with a database, generating HTML files</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hewryE3nxzTjQtWvXJF1Uw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/1*Iyy0FwB0_H-TbitMFO8YBg.png" /></figure><h3><strong>B)Data science:</strong></h3><p>Python is a programming language widely used by Data Scientists.</p><p>Python has in-built mathematical libraries and functions, making it easier to calculate mathematical problems and to perform data analysis</p><h4>Python Libraries</h4><ul><li>Pandas — This library is used for structured data operations, like import CSV files, create dataframes, and data preparation</li><li><a href="https://www.w3schools.com/python/numpy_intro.asp">Numpy</a> — This is a mathematical library. Has a powerful N-dimensional array object, linear algebra, Fourier transform, etc.</li><li><a href="https://www.w3schools.com/python/matplotlib_intro.asp">Matplotlib</a> — This library is used for visualization of data.</li><li><a href="https://www.w3schools.com/python/scipy_intro.asp">SciPy</a> — This library has linear algebra modules</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/311/1*APq-n5BXf6digfDBoyhQwQ.jpeg" /></figure><h3>c)Machine learning</h3><p>In the real world, we are surrounded by humans who can learn everything from their experiences with their learning capability, and we have computers or machines which work on our instructions. But can a machine also learn from experiences or past data like a human does? So here comes the role of <strong>Machine Learning.</strong></p><p>machine learning involves building mathematical models to help understand data.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6b66fe08eec" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>