<?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 saurabh nayak on Medium]]></title>
        <description><![CDATA[Stories by saurabh nayak on Medium]]></description>
        <link>https://medium.com/@saurabhnk94?source=rss-78fa44911781------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*ocfYFTLbQu4ivufe</url>
            <title>Stories by saurabh nayak on Medium</title>
            <link>https://medium.com/@saurabhnk94?source=rss-78fa44911781------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 06:13:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@saurabhnk94/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[Regular Expressions]]></title>
            <link>https://medium.com/@saurabhnk94/regular-expressions-bfba409a80e5?source=rss-78fa44911781------2</link>
            <guid isPermaLink="false">https://medium.com/p/bfba409a80e5</guid>
            <category><![CDATA[regex]]></category>
            <dc:creator><![CDATA[saurabh nayak]]></dc:creator>
            <pubDate>Wed, 25 Sep 2019 03:24:19 GMT</pubDate>
            <atom:updated>2019-09-25T10:07:22.810Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello Everyone!!</p><p>Regular expressions is one of the most complicated but very important topic in any programming languages. We shall learn some of the operators used in regex. Regex expressions are the text matching patterns described with a formal syntax(referred as regex or regexp). These can have variety of rules, for finding repetition, to text matching.</p><p>Lets first learn about few common operators used to generate an expression:-</p><pre>+--------------+------------------------------------------------+<br>|  Operators   |                 Description                    |<br>+--------------+------------------------------------------------+<br>|     .        |any single character except newline &#39;\n&#39;        |<br>+--------------+------------------------------------------------+<br>|     ?        |match 0 or 1 occurrence of the pattern to its   |<br>|              | left                                           |<br>+--------------+------------------------------------------------+<br>|     +        |1 or more occurrence of the pattern to its left |<br>+--------------+------------------------------------------------+<br>|     *        |0 or more occurrence of the pattern to its left |<br>+--------------+------------------------------------------------+<br>|     \w       |matches with the alphanumeric character         |<br>+--------------+------------------------------------------------+<br>|     \W       |matches non alphanumeric character              |<br>+--------------+------------------------------------------------+<br>|     \d       |Matches with digits [0-9]                       |<br>+--------------+------------------------------------------------+<br>|     \D       |matches with non-digits                         |<br>+--------------+------------------------------------------------+<br>|     \s       |Matches with single white space character       |          <br>+--------------+------------------------------------------------+<br>|     \S       |Matches any non white space character           |     <br>+--------------+------------------------------------------------+<br>|     \        |It is used for special meaning character like to|<br>|              | match a period or + for plus sign              |                 <br>+--------------+------------------------------------------------+<br>|   ^ and $    |start or end of the string respectively         |     <br>+--------------+------------------------------------------------+</pre><p><strong>Modules in Regular expressions</strong> :</p><p>Basically ‘re’ is a module named for Regex.</p><pre>#Example: to find the number in a pattern from a given string<br>&gt;&gt;&gt;phone_number = re.compile(r&#39;\d\d\d-\d\d\d-\d\d\d\d&#39;)<br>&gt;&gt;&gt;matches = phone_number.search(&#39;My number is 123-456-7891.&#39;)<br>&gt;&gt;&gt;print(&#39;Phone number found : &#39; + matches.group())<br>Phone number found : 123-456-7891</pre><p><strong>Matching Regex Objects</strong> :</p><p>In regex operations search() method will search in the particular string which matches the regex expression. It returns None if there is no match. If it finds the pattern then search() method returns the Match object. Match objects have a group() method that will return the actual matched text from the string.</p><p>Suppose we want to separate the area code from the phone number or in any other cases given. Use group() match object method to grab the matching text from one group. Put the regex expressions inside the parenthesis as shown below</p><pre>&gt;&gt;&gt;phone_number = re.compile(r&#39;(\d\d\d)-(\d\d\d)-(\d\d\d\d)&#39;)<br>&gt;&gt;&gt;matches = phone_number.search(&#39;My number is 123-456-7891.&#39;)<br>&gt;&gt;&gt;matches.group(1)<br>&#39;123&#39;<br>&gt;&gt;&gt;matches.group(2)<br>&#39;456&#39;<br>&gt;&gt;&gt;matches.group(3)<br>&#39;7891&#39;</pre><p><strong>Matching Multiple Groups with the pipe</strong> :</p><p>The | character is called pipe. This can be used anywhere to match one of the many expressions. It will give output of the first occurrence from the matching text.</p><pre>&gt;&gt;&gt;veggies = re.compile(r&#39;onion|tomato&#39;)<br>&gt;&gt;&gt;match = veggies.search(&#39;onion and tomato.&#39;)<br>&gt;&gt;&gt;match.group()<br>&#39;onion&#39;</pre><pre>&gt;&gt;&gt;veggies = re.compile(r&#39;onion|tomato&#39;)<br>&gt;&gt;&gt;match = veggies.search(&#39;tomato and onion.&#39;)<br>&gt;&gt;&gt;match.group()<br>&#39;tomato&#39;<br></pre><p><strong>Optional matching</strong> :</p><p>This can be done using the operator ‘?’(Question mark). This character flags the group that precedes it as an optional part of the pattern.</p><pre>&gt;&gt;&gt;bat_regex = re.compile(r&#39;Bat(wo)?man&#39;)<br>&gt;&gt;&gt;match = bat_regex.search(&#39;The Adventures of Batman.&#39;)<br>&gt;&gt;&gt;match.group()<br>&#39;Batman&#39;<br>&gt;&gt;&gt;match = bat_regex.search(&#39;The Adventures of Batwoman.&#39;)<br>&gt;&gt;&gt;match.group()<br>&#39;Batwoman&#39;</pre><p>findall() : This will return all the matches as a list representing as one match.</p><pre>&gt;&gt;&gt;phone_number = re.compile(r&#39;\d\d\d-\d\d\d-\d\d\d\d&#39;)<br>&gt;&gt;&gt;phone_number.findall(&#39;My number is 123-456-7891 and 987-654-4321.&#39;)<br>[&#39;123-456-7891&#39;,&#39;987-654-4321&#39;]</pre><p>Thank You for reading this blog.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bfba409a80e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dictionary, tuples and sets]]></title>
            <link>https://medium.com/@saurabhnk94/dictionary-tuples-and-sets-a72193df65ff?source=rss-78fa44911781------2</link>
            <guid isPermaLink="false">https://medium.com/p/a72193df65ff</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[saurabh nayak]]></dc:creator>
            <pubDate>Tue, 24 Sep 2019 03:21:02 GMT</pubDate>
            <atom:updated>2019-09-24T12:39:09.985Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello everyone!!</p><p>In my previous blog you might have read about Lists and its processes. In this blog you shall learn about the topics of Dictionary, tuples, sets and their operations in python programming.</p><p>First let me tell you about <strong>Dictionary </strong>and their operations.</p><p>Dictionary is like a list but its more general. In a list, the indices have to be integers but in Dictionary it can be of any type. Basically we can say it like mapping between a set of indices(which are called keys) and a set of values. Each key maps to a value. It is key-value pair which can also be called as item. Function dict creates a new dictionary with no items. Because dict is a name of a built-in function,thus avoid using it as a variable name. It is represented in flower brackets “{}”.</p><pre>#For an empty dictionary <br>&gt;&gt;&gt;variable_name = {}<br>or<br>&gt;&gt;&gt;variable_name = dict()</pre><pre># to add items to the dictionary<br>&gt;&gt;&gt; variable_name[&#39;one&#39;] = &#39;uno&#39;<br>{&#39;one&#39;:&#39;uno&#39;}<br>&gt;&gt;&gt;variable_name ={&#39;one&#39;:&#39;pen&#39;,&#39;two&#39;:&#39;balloons&#39;,&#39;three&#39;:&#39;trees&#39;}<br>&gt;&gt;&gt;variable_name<br>{&#39;one&#39;:&#39;pen&#39;,&#39;three&#39;:&#39;trees&#39;,&#39;two&#39;:&#39;balloons&#39;}</pre><p>Note: To get the elements of a dictionary you use keys and not the integer indices of the dictionary. Order of the items doesn’t matter because the key always maps to its value.</p><pre>Example:<br>&gt;&gt;&gt;variable_name[&#39;two&#39;]<br>&#39;balloons&#39;</pre><pre>#Suppose key is not in that dictionary <br>&gt;&gt;&gt; variable_name[&#39;four&#39;]<br>KeyError: &#39;four&#39;</pre><p>The len function works in dictionaries : it returns the key-value pairs.</p><pre>&gt;&gt;&gt;len(variable_name)<br>3</pre><p>Lets learn about <strong>tuples </strong>now:</p><p>A tuple is a sequence of values. The value can be of any type and they are indexed by integers. The main difference is that tuples are immutable. It is denoted inside the -&gt; ().</p><pre>&gt;&gt;&gt; t = &#39;a&#39;,&#39;b&#39;,&#39;c&#39; #it is a tuple<br>#it is better to write in the below manner<br>&gt;&gt;&gt; t = (&#39;a&#39;,&#39;b&#39;,&#39;c&#39;)</pre><pre>#For empty tuple<br>&gt;&gt;&gt;t = tuple()<br>&gt;&gt;&gt;t<br>()</pre><pre>#If the argument is a sequence, the result will be a tuple in a sequence<br>&gt;&gt;&gt; t = tuple(&#39;lupins&#39;)<br>&gt;&gt;&gt; t<br>(&#39;l&#39;,&#39;u&#39;,&#39;p&#39;,&#39;i&#39;,&#39;n&#39;,&#39;s&#39;)</pre><pre>#Most list operators work on tuples:<br>&gt;&gt;&gt;t = (&#39;a&#39;,&#39;b&#39;,&#39;c&#39;,&#39;d&#39;)<br>&gt;&gt;&gt;t[0]<br>&#39;a&#39;</pre><pre>#Slicing<br>&gt;&gt;&gt;t[1:3]<br>(&#39;b&#39;,&#39;c&#39;)</pre><pre>#replace: <br>&gt;&gt;&gt;t = (&#39;a&#39;,&#39;b&#39;,&#39;c&#39;,&#39;d&#39;)<br>&gt;&gt;&gt;t = (&#39;A&#39;,) + t[1:]<br>(&#39;A&#39;,&#39;b&#39;,&#39;c&#39;,&#39;d&#39;)</pre><p>Note : Avoid using tuple as a variable name as tuple is a built-in function. We cannot modify in the tuple : it throws an error.</p><p>Lets learn about <strong>Sets</strong>:</p><p>Set in python is a data structure equivalent to sets in mathemetics. It may consists of various elements; the order of in a set is undefined. You can perform add, delete,iterate and also standard operations like union, intersection, differences . You can also check whether the element is present in the set. It gives the output in inside the -&gt;{}.</p><pre>#to add elements<br>&gt;&gt;&gt;x.add(1)<br>&gt;&gt;&gt;x<br>{1}</pre><pre>&gt;&gt;&gt;x.add(2)<br>&gt;&gt;&gt;x<br>{1,2}</pre><pre>#take repeated values from the list<br>&gt;&gt;&gt;l= [1,1,2,3,4,4,5,6,6]<br>&gt;&gt;&gt;set(l)<br>{1,2,3,4,5,6}<br></pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a72193df65ff" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[List Data Type]]></title>
            <link>https://medium.com/@saurabhnk94/list-data-type-bbc4c9af2492?source=rss-78fa44911781------2</link>
            <guid isPermaLink="false">https://medium.com/p/bbc4c9af2492</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[saurabh nayak]]></dc:creator>
            <pubDate>Mon, 23 Sep 2019 13:00:49 GMT</pubDate>
            <atom:updated>2019-09-23T13:00:49.730Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello Everyone!!</p><p>In this blog I will explain about lists and various aspects about working in the list.Basically this is very much useful in the programming and it helps to store the data.Lets start!!</p><h3>What is a list??</h3><p>A list is a value that contains multiple values in an ordered list. It is denoted inside the square brackets -&gt; []. The values inside the list are called as items and these items are separated by commas(,). There can be multiple lists. Some examples for the lists are</p><pre>spam_1 = []    #this is to denote the empty list<br>spam_2 = [&#39;cat&#39;,&#39;dog&#39;,&#39;bat&#39;,&#39;elephant&#39;]<br>spam_3 = [1,2,3,4,5]<br>spam_4 = [[&#39;cat&#39;,&#39;bat&#39;],[1,3,5,7]]<br> </pre><h4><strong>How to access individual values in the list?</strong></h4><p>The integers inside the square brackets that follows the list is called an index. The index refers to that particular item in the list of that index. For example:</p><pre>Example 1:<br>&gt;&gt;&gt;spam = [&#39;cat&#39;,&#39;dog&#39;,&#39;bat&#39;,&#39;elephant&#39;]<br>&gt;&gt;&gt;spam[0]<br>cat<br>&gt;&gt;&gt;spam[2]<br>bat<br>&gt;&gt;&gt;spam[3]<br>elephant<br>&gt;&gt;&gt;spam[100]<br>This will give an error showing as &#39;IndexError:list index out of range &#39; if the index value exceeds the number of values in the list.<br></pre><pre>Example 2:<br>&gt;&gt;&gt;multiple_spam = [[&#39;cat&#39;,&#39;dog&#39;],[1,2,3,4,5]]<br>&gt;&gt;&gt;multiple_spam[0]<br>[&#39;cat&#39;,&#39;dog&#39;]<br>&gt;&gt;&gt;multiple_spam[0][1]<br>&#39;dog&#39;<br>&gt;&gt;&gt;multiple_spam[1][3]<br>4</pre><pre><br>Example 3: Negative indexes<br>&gt;&gt;&gt;spam = [&#39;cat&#39;,&#39;dog&#39;,&#39;bat&#39;,&#39;elephant&#39;]<br>&gt;&gt;&gt;spam[-1]<br>&#39;elephant&#39;         #&#39;-1&#39; refers to the last index<br>&gt;&gt;&gt;spam[-3]<br>&#39;dog&#39;</pre><p><strong>Note</strong>: The index value must be of integer type and not float type.</p><h3><strong>Sublists with Slices:</strong></h3><p>Index can get the single value from a list. But through slicing we can get several values from the list in the form of a new list.</p><pre>&gt;&gt;&gt;spam = [&#39;cat&#39;,&#39;dog&#39;,&#39;bat&#39;,&#39;elephant&#39;]<br>&gt;&gt;&gt; spam[1:3]<br>[&#39;dog&#39;,&#39;bat&#39;]<br>&gt;&gt;&gt;spam[1:]<br>[&#39;dog&#39;,&#39;bat&#39;,&#39;elephant&#39;]<br>&gt;&gt;&gt;spam[:]<br>[&#39;cat&#39;,&#39;dog&#39;,&#39;bat&#39;,&#39;elephant&#39;]<br>&gt;&gt;&gt;spam[0:-1]<br>[&#39;cat&#39;,&#39;dog&#39;,&#39;bat&#39;]</pre><p><strong>List length:</strong> len() function will return the number of values that are in a list.</p><pre>&gt;&gt;&gt;spam = [&#39;cat&#39;,&#39;dog&#39;,&#39;bat&#39;,&#39;elephant&#39;]<br>&gt;&gt;&gt;len(spam)<br>4</pre><p><strong>Updating list using the indexes </strong>: We can change the value of the list using the index of which item to be changed.</p><pre>&gt;&gt;&gt;spam = [&#39;cat&#39;,&#39;dog&#39;,&#39;bat&#39;,&#39;elephant&#39;]<br>&gt;&gt;&gt;spam[3] = &#39;rat&#39;<br>[&#39;cat&#39;,&#39;dog&#39;,&#39;bat&#39;,&#39;rat&#39;]<br>&gt;&gt;&gt;spam[2] = &#39;elephant&#39;<br>[&#39;cat&#39;,&#39;dog&#39;,&#39;elephant&#39;,&#39;rat&#39;]</pre><p><strong>List concatenation and replication </strong>:</p><ol><li>The + operator can combine two lists to create a new list value.</li><li>The * operator can also be used with a list and an integer value to replicate the list.</li></ol><pre>&gt;&gt;&gt;[1,2,3] + [&#39;a&#39;,&#39;b&#39;,c&#39;]<br>[1,2,3,&#39;a&#39;,&#39;b&#39;,c&#39;]<br>&gt;&gt;&gt;[&#39;x,&#39;y&#39;,&#39;z&#39;]*3<br>[&#39;x,&#39;y&#39;,&#39;z&#39;,&#39;x,&#39;y&#39;,&#39;z&#39;,&#39;x,&#39;y&#39;,&#39;z&#39;]<br>&gt;&gt;&gt;spam = [1,2,3]<br>&gt;&gt;&gt;spam = spam + [&#39;a&#39;,&#39;b&#39;,c&#39;]<br>&gt;&gt;&gt;spam<br>[1,2,3,&#39;a&#39;,&#39;b&#39;,c&#39;]</pre><p><strong>Remove value from list</strong> : The del statement will delete values at an index in a list.</p><pre>&gt;&gt;&gt;spam = [&#39;cat&#39;,&#39;dog&#39;,&#39;bat&#39;,&#39;elephant&#39;]<br>&gt;&gt;&gt;del spam[2]<br>&gt;&gt;&gt;spam<br>[&#39;cat&#39;,&#39;dog&#39;,&#39;elephant&#39;]</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bbc4c9af2492" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[File Handling and OS modules]]></title>
            <link>https://medium.com/@saurabhnk94/file-handling-and-os-modules-1e46dd6ea890?source=rss-78fa44911781------2</link>
            <guid isPermaLink="false">https://medium.com/p/1e46dd6ea890</guid>
            <category><![CDATA[terminal]]></category>
            <dc:creator><![CDATA[saurabh nayak]]></dc:creator>
            <pubDate>Wed, 11 Sep 2019 12:19:25 GMT</pubDate>
            <atom:updated>2019-09-12T11:09:22.605Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello Everyone!!</p><p>Do you know about file handling and OS modules? If not read the below context! You might get some idea about these. Today I learnt some concepts regarding these. Lets begin one by one.</p><h3><strong>File Handling</strong> :</h3><p>What is meant by file? File is a named location on the system storage where it stores the data for the later access.</p><p>The processing order for the file handling are:</p><ol><li>open(): This is a built in function which is used to open the file. This file can be read or write or append according to the modes mentioned.</li></ol><pre>syntax:<br>file_object = open(&quot;file_name&quot;,&quot;access_mode&quot;)</pre><p>In the above syntax :</p><p>file_name : it is a file name you want to access.</p><p>access_mode: There are several modes in which you can access the file like read or write or read and write or append.</p><p>2. close(): This is used to close the file which we have opened.</p><pre>syntax:<br>file_object.close()</pre><p>3. write(): This is used to write the text in the file we want to add. It basically starts from the beginning of the file.</p><pre>syntax :<br>file_content = &quot;Hello TARZAN&quot;<br>file_object.write(file_content)</pre><p>4. read() : This is used to read the data from the file you want to read. Basically the Python string can have binary data and not just the text.</p><pre>syntax:<br>file_object.read()</pre><p>Suppose you want to read a certain number of bytes then the syntax will be file_object.read(count) .</p><p>5. tell() : This will tell you the current position within the file. The next read or write will occur at that many bytes from the beginning of the file.</p><pre>syntax:<br>file_object.tell()</pre><p>6. seek() : This is used to change position of the current file.</p><pre>syntax:<br>file_object.seek(offset,[from]</pre><p>Here <strong>offset</strong> is used to indicate the number of bytes to be moved and <strong>from </strong>is used to refer the position from where the bytes are to be moved.</p><p><strong>File MODES</strong>: There are a many modes in this. Important once I will be explaining in the below context.</p><p>r = It opens in the read only mode , w = It creates the file in write mode, a=It creates a file in append mode.</p><h3><strong>OS Module</strong> :</h3><p>This module provides the user to interact with the functions of operating system. OS comes under the Python’s standard utility modules. To interact with the file system os and os.path modules are used which includes function. Lets discuss some of the operations :</p><ol><li>os.getcwd() :</li></ol><p>This returns the path of the Current Working Directory (CWD) of the file used to execute the code. Note: this can vary from system to system.</p><pre>Syntax:<br>import os<br>print(os.getcwd())</pre><p>2. os.chdir(path) :</p><p>This is used to change the Current Working Directory to path.</p><pre>Syntax : <br>import os <br>os.chdir(&#39;/&#39;)</pre><p>3. os.listdir(path) :</p><p>This executes the list in that particular directory of the given path.</p><pre>Syntax:<br>import os<br>os.listdir(&#39;/&#39;)</pre><p>4. os.remove(path) :</p><p>This removes the file path. If the path is the directory then OS error is raised.</p><pre>Syntax :<br>import os<br>os.remove(&quot;file_name.txt&quot;</pre><p>5.os.rename():</p><p>This is used to rename the file. Below syntax will explain. Suppose I have a file of age.py and I have to change it to ages.py</p><pre>Syntax:<br>import os <br>os.rename(&#39;age.py&#39;,&#39;ages.py&#39;)</pre><p>6. os.path.exists():</p><p>It returns True if path refer to the existing path else it will return False.</p><pre>Syntax : <br>import os<br>os.path.exists(&#39;/home/saurabhnayak/tarzan/TARZANSKILL/file.txt&#39;)</pre><p>7. os.path.abspath() :</p><p>This will determine the absolute version of the path.</p><pre>Syntax :<br>os.path.abspath(&#39;./tarzan/TARZANSKILLS/&#39;)<br>output:<br>&#39;/home/saurabhnayak/tarzan/TARZANSKILLS/tarzan/TARZANSKILLS&#39;</pre><p>8. os.path.relpath(path,[start]) :</p><p>This returns a relative file path to path either from the current directory or from an optional start point.</p><pre>Syntax : <br>import os <br>os.path.relpath(&#39;/tarzan/TARZANSKILLS/&#39;)</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e46dd6ea890" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[FOR LOOPS]]></title>
            <link>https://medium.com/@saurabhnk94/for-loops-ad6129b43938?source=rss-78fa44911781------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad6129b43938</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[saurabh nayak]]></dc:creator>
            <pubDate>Tue, 10 Sep 2019 13:43:35 GMT</pubDate>
            <atom:updated>2019-09-10T13:43:35.006Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello Everyone!!</p><p>Today its gonna be a short and sweet blog. I have a learnt about <strong>range</strong> , <strong>for</strong> <strong>loop</strong>, <strong>for loops</strong> using <strong>range</strong>. Later solved programs regarding these many topics.</p><p><strong>for loops : </strong>When execution of the code to be used repeatedly in a loop variable. This loop is used when the iteration of the loop is known before entering the loop.</p><pre>Syntax : <br>for [iterating variable] in [sequence]<br>    [statement/code]</pre><p>In the above syntax the [statement/code] will be executed until the sequence is over.</p><pre>Example : <br>for value in range(0,5)<br>    print(value)</pre><pre>output:<br>0<br>1<br>2<br>3<br>4</pre><p><strong>for loops using range()</strong> : However with the help of above example you will come to know the importance of range. It actually controls how many times the loop will be repeated.</p><p>That is all for the day!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad6129b43938" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Loops and functions in PYTHON-3]]></title>
            <link>https://medium.com/@saurabhnk94/loops-and-functions-in-python-3-c624e9109e70?source=rss-78fa44911781------2</link>
            <guid isPermaLink="false">https://medium.com/p/c624e9109e70</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[saurabh nayak]]></dc:creator>
            <pubDate>Mon, 09 Sep 2019 12:32:08 GMT</pubDate>
            <atom:updated>2019-09-09T12:32:08.602Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello Everyone!!</p><p>Day-5 at TARZAN SKILLS</p><p>Well let me tell you what I have learnt today. So basically the class started with the recap of previous sessions. Today’s session was about<strong> flow controls:</strong> conditions like <strong>if</strong> , <strong>elif</strong> ,<strong>else</strong>, <strong>while</strong> <strong>loop</strong>, <strong>break</strong> , <strong>continue. </strong>So lets get straight to the topics.</p><p><strong>FLOW CONTROL: </strong>It is a systematic way of processing the data in a program. It gives the output with respect to the instructions, statements ,conditions is evaluated in the program.</p><p><strong>if statement</strong>: This statement is used when there is a condition where in, only if the condition is satisfied, it will execute the statements inside that. If the condition is not satisfied then it will ignore the statements inside that.</p><pre>Syntax:<br>if expression:<br>      statement_1<br>      statement_2<br>      ...</pre><pre>Example:<br>a=8<br>b=9<br>if a&lt;b:<br>   print(&quot;a is smaller than b&quot;)</pre><pre>Output: <br>a is smaller than b</pre><p><strong>if else statement: </strong>If the expression is satisfied then it prints the statement inside the if, if not it will execute the statement inside the else statement.</p><pre>Syntax:<br>if expression:<br>    statement_1<br>else:<br>    statement_2<br>Example:<br>a=10<br>b=9<br>if a&lt;b:<br>   print(&quot;a is smaller than b&quot;)<br>else:<br>   print(&quot;a greater than b&quot;)<br>Output:<br>a greater than b</pre><p><strong>if elif</strong> <strong>statement</strong>: It is used when there is various conditions to be evaluated in a program.</p><pre>Syntax:<br>if expression1:<br>  statement_1<br>  statement_2<br>elif expression2:<br>  statement_3<br>  statement_4<br>elif expression3:<br>  statement_5<br>  statement_6<br>else:<br>  statement_7</pre><pre>Example:<br>number = int(input(&quot;Enter the Number : &quot;))</pre><pre>if number==1:<br>    print(&quot;one&quot;)<br>elif number==2:<br>    print(&quot;two&quot;)<br>elif number==3:<br>    print(&quot;three&quot;)<br>elif number==4:<br>    print(&quot;four&quot;)<br>elif number==5:<br>    print(&quot;five&quot;)<br>elif number==6:<br>    print(&quot;six&quot;)<br>elif number==7:<br>    print(&quot;seven&quot;)<br>elif number==8:<br>    print(&quot;eight&quot;)<br>elif number==9:<br>    print(&quot;nine&quot;)<br>else:<br>    print(&quot;Greater than nine&quot;)</pre><pre>Output: Enter the Number : &lt;number&gt; <br>#(Suppose we type 8 in place of number <br>we get the output as)<br>eight</pre><p><strong>While Loop: </strong>Loops are used to repeatedly execute the statements or operations inside the look until the condition/expression is terminated or doesn’t satisfy.</p><pre>Syntax:<br>while expression:<br>  statement_1<br>  statement_2<br>  ....</pre><pre>Example:<br># square of an integer</pre><pre>number=int(input(&quot;Enter a number : &quot;))<br>i=0</pre><pre>while i&lt;number:<br>    print(i**2)<br>    i=i+1</pre><pre>Output:<br>Enter a number : &lt;number&gt;<br>#(suppose we put number as 4 output will be)<br>0<br>1<br>4<br>9</pre><p><strong>Break statement</strong>: The break statement is used to exit a for or a while loop. The purpose of this statement is to end the execution of the loop immediately and the program control goes to the last statement of the loop.</p><pre>Syntax:<br>while expression1:<br>   statement_1<br>   statement_2<br>   ...<br> <br>   if expression2:<br>       break</pre><pre>Example:<br>while True:<br>    name = input(&quot;Enter your name : &quot;)<br>    if name == &#39;varun&#39;:<br>        break<br>print(&quot;Welcome, varun&quot;)</pre><pre>Output:<br>Enter your name : ram<br>Enter your name : saurabh<br>Enter your name : abhishek<br>Enter your name : varun<br>Welcome, varun</pre><p><strong>Continue Statement</strong>: When the program execution reaches a continue statement, the program execution immediately jumps back to the start of the loop and reevaluates the loop condition.</p><pre>while expression1:<br>   statement_1<br>   statement_2<br>   ....<br>   if expression2:<br>      continue</pre><p>These are the basics learnt today with many more examples. That’s all for the day.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c624e9109e70" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python functions and strings]]></title>
            <link>https://medium.com/@saurabhnk94/python-functions-and-strings-fcf37fa82cb3?source=rss-78fa44911781------2</link>
            <guid isPermaLink="false">https://medium.com/p/fcf37fa82cb3</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[saurabh nayak]]></dc:creator>
            <pubDate>Fri, 06 Sep 2019 12:20:43 GMT</pubDate>
            <atom:updated>2019-09-06T12:20:43.586Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello!!</p><p>Lets learn about strings and functions in this blog. It was a very good session. We learnt how does a string and functions work. So let me give some some exam.</p><p><strong>String</strong>- It is actually a data type which stores sequence of letters or numbers.But normally it is used to define the group of characters.In Python there is no need to specifically assign data types for string. It takes it directly.</p><p>User defined Inputs: It is a program where in you put your inputs and and not assigning the values in the program.</p><pre>first_name= input(&quot;Please enter your name: &quot;)<br>last_name= input(&quot;Enter your last name: &quot;)<br>age= input(&quot;Enter your age: &quot;)<br>salary= input(&quot;Mention your salary: &quot;)<br>val= str(first_name)<br>print(&quot;Hi &quot; + first_name + &quot; &quot; + last_name + &quot;\n&quot; + &quot;Your age is &quot; + age + &quot;and your salary is &quot; + salary)</pre><pre>Output<br>Please enter your name: &lt;name&gt;<br>Enter your last name: &lt;lastname&gt;<br>age= &lt;age&gt;<br>salary= &lt;amount&gt;<br>Hi &lt;name&gt;&lt;lastname&gt;<br>Your age is &lt;age&gt;and and your salary is &lt;amount&gt; </pre><p><strong>Functions</strong>- It is block of codes which contains the arguments and parameters. This is very helpful in programming since it has the reusable again and again.</p><p>Example:</p><pre>def add(a,b):<br>    return a+b<br>example</pre><pre>1.print(add(3,4))<br>OUTPUT- 7<br>2.first_name=&quot;MAHENDER&quot;<br>  last_name=&quot;SINGH&quot;<br>OUTPUT- MAHENDERSINGH<br>3.from decimal import Decimal<br>  print(add(Decimal(&#39;1.1&#39;),Decimal(&#39;2.2&#39;)))<br>OUTPUT- 3.3</pre><p>Thank you for the day!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fcf37fa82cb3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TARZAN SKILLS]]></title>
            <link>https://medium.com/@saurabhnk94/tarzan-skills-6e45dd04d944?source=rss-78fa44911781------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e45dd04d944</guid>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[saurabh nayak]]></dc:creator>
            <pubDate>Thu, 05 Sep 2019 12:17:45 GMT</pubDate>
            <atom:updated>2019-09-05T12:17:45.259Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello everyone!</p><p><strong>Python</strong> a general purpose and a high level programming language. It is very easy to read and understand the program compared to other programming languages.</p><p>Basically today I came to know about certain commands in git</p><ol><li>git config credential.helper store : Using this helper will store your passwords unencrypted on disk, protected only by filesystem permission.</li><li>git push : push commits made on a local branch to a remote repository.</li></ol><pre>git push origin master</pre><p>3. git pull : Incorporates changes from a remote repository into the current branch. Mainly to avoid bugs in the master.</p><p>Do you know about git branching? If no check this out.</p><ul><li>In a master different branches can be created.</li><li>Firstly we have to pull the master to your branch and then do corrections or updations in the branch itself so that master will be secured.</li><li>Importantly before we run the program we must again pull the master files so that if any changes done should be reflected on to your corrections. So that the corrections done will run smoothly and can be updated to the master once it is validated and approved by the higher authority.</li></ul><p>We also came across various mathematical operators like +,-,/,*,&lt;,&gt;,≤,≥. How does it respond to the variables in the python interpretor.We also came across PEMDAS which is a problem solving technique used in python.</p><p>VARIABLES: A Python variable<strong> </strong>is a reserved memory location to store values. In other words, a variable in a python<strong> </strong>program gives data to the computer for processing.It is very easy to assign values in this.</p><pre>first_name= &quot;GANESHA&quot;<br>last_name= &quot;Prasad&quot;<br>age= 26<br>print(first_name,last_name,age)<br>output= GANESHA Prasad 26</pre><p>Thank you</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e45dd04d944" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[1st day of PYTHON Training]]></title>
            <link>https://medium.com/@saurabhnk94/1st-day-of-python-training-151488095c98?source=rss-78fa44911781------2</link>
            <guid isPermaLink="false">https://medium.com/p/151488095c98</guid>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[saurabh nayak]]></dc:creator>
            <pubDate>Wed, 04 Sep 2019 11:43:15 GMT</pubDate>
            <atom:updated>2019-09-04T11:43:15.725Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello!!.</p><p>TARZAN skills program which is to be held for 16 weeks on PYTHON programming. It was a wonderful session today. I am basically a Mechanical Engineer but they thought it so wonderfully that we could understand it clearly. Today we learnt 3 main aspects i.e.;GIT and GITHUB, basics on pycharm and terminal which is linked to the directory.</p><p>Basically we operated on GIT by creating a file on it and keep updating on the same. We have learnt commands like mkdir, ls, cd, git status, git add, git push and git commit.</p><p>We also learnt about how to print on PyCharm application. Varieties of practice problems were solved and also inputs on sep and end arguments were thought. How those arguments work.</p><p>It was a very good session for me and learning is very much advanced for the present scenario. I would recommend the freshers to get into this learning which would enhance your career.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=151488095c98" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>