<?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 Yatheesha Madagala on Medium]]></title>
        <description><![CDATA[Stories by Yatheesha Madagala on Medium]]></description>
        <link>https://medium.com/@yatheeshamadagala?source=rss-7340252012c5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Yatheesha Madagala on Medium</title>
            <link>https://medium.com/@yatheeshamadagala?source=rss-7340252012c5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 13:15:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yatheeshamadagala/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 — Basic to Advanced-Day6]]></title>
            <link>https://medium.com/@yatheeshamadagala/python-basic-to-advanced-day6-3944e0cdf295?source=rss-7340252012c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/3944e0cdf295</guid>
            <dc:creator><![CDATA[Yatheesha Madagala]]></dc:creator>
            <pubDate>Thu, 21 Sep 2023 09:27:57 GMT</pubDate>
            <atom:updated>2023-09-21T09:27:57.630Z</atom:updated>
            <content:encoded><![CDATA[<h3>Python — Basic to Advanced-Day6</h3><p>Kudos!! Hope the stories helping you in revising the concepts and learning the content in a proper way. I am so happy that you are being excited to continue with the series. Never too late to revise the concepts from previous blogs. please follow the below link for previous strories.</p><p><a href="https://medium.com/@yatheeshamadagala/python-basic-to-advanced-day5-1a5ca6a3b067">Python — Basic to Advanced-Day5. Congratulations!! on reaching a new… | by Yatheesha Madagala | Medium</a></p><p>Lets discuss on print function today.</p><p><strong>Print() function</strong></p><p>This most popular function which we use more than anything else. print() is used to show something on screen. We can use any of the following formats:<br>print(“&lt;string&gt;” )<br>print(‘&lt;string&gt;’)<br>print(“””&lt;string&gt;”””)</p><pre>a = 5<br>b = 6<br>print(&quot;sum of a + b is :&quot;, a+b)<br><br>output:<br>sum of a+b is: 11</pre><p>Always use strings inside the double quotes and the variables without quotes. This is not the only way there are few which we can discuss further.</p><p><strong>Using f or .format keyword</strong></p><p>f keyword is used before the quotes to format the object in elegant way.</p><pre>a = 5; b = 6<br>print(f&quot;sum of a+b is {a+b}&quot;)<br><br>output:<br>sum of a+b is 11<br><br>#using .format<br>print(&quot;sum of a+b is :{}&quot;.format(a+b))<br><br>output:<br>sum of a+b is :11</pre><p><strong>Using r keyword</strong></p><p>We can also use r keyword to print the string as it is without considering any escape sequence or quotes.</p><pre>print(r&quot;Legends \n are geeks&quot;)<br><br>output:<br>Legends are geeks<br><br>#without r keyword<br>print(&quot;Legends \n are geeks&quot;)<br><br>output:<br>Legends<br>are geeks</pre><p>You may already have a doubt that what is escape sequence. Lets discuss on this.</p><p>python has few special characters which is defined for specific functionality.</p><p>\ — To escape the special characters like single quotes, double quotes, \n, \t<br>\n — To enter a new line<br>\b — Used as backslash<br>\t — Used for tab(to provide 4 spaces)</p><pre>print(&quot;a \n b&quot;)      #prints line1: a line2:b <br>print(&quot;a \t b&quot;)      #prints a     b<br>print(&quot;a \b b&quot;)      #prints a b<br>print(&quot;a \\n b&quot;)     #prints a \n b<br>print(&quot;a \&quot; \&quot; b&quot;)   #prints a &quot; &quot; b</pre><p>Yes We are done for the day please do practice few more examples and let me know how you feel. Its ok if it is hectic. By time we will become more comfortable.</p><p>Some Exercises you can try:<br>1. Display three string “Name”, “Is”, “James” as “Name**Is**James”<br>2. Display float number with 2 decimal places using print()<br>3. Print Johny Johny yes papa rhyme in 4 lines</p><h3>Conclusion:</h3><p>Congratulations!! you have reached a milestone. Please be consistent in learning and programming.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*4DySojiSc-8B8zba.gif" /></figure><p>Thanks for reading. Hope you liked the story. Please follow regularly as I will be posting this short stories continuously so we will not miss the flow as I will be publishing the series on python.</p><p>If you want to reach out to me for any comments or help:</p><p>yatheeshamadagala@gmail.com</p><p><a href="https://www.linkedin.com/in/yatheesha-madagala-178386157">https://www.linkedin.com/in/yatheesha-madagala-178386157</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3944e0cdf295" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python — Basic to Advanced-Day5]]></title>
            <link>https://medium.com/@yatheeshamadagala/python-basic-to-advanced-day5-1a5ca6a3b067?source=rss-7340252012c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a5ca6a3b067</guid>
            <category><![CDATA[dictionary-exercise]]></category>
            <category><![CDATA[dictionaries-in-python]]></category>
            <category><![CDATA[dictionary]]></category>
            <category><![CDATA[dictionary-comprehension]]></category>
            <category><![CDATA[dictionary-methods]]></category>
            <dc:creator><![CDATA[Yatheesha Madagala]]></dc:creator>
            <pubDate>Mon, 14 Nov 2022 01:08:06 GMT</pubDate>
            <atom:updated>2022-11-14T01:08:06.494Z</atom:updated>
            <content:encoded><![CDATA[<h3>Python — Basic to Advanced-Day5</h3><p>Congratulations!! on reaching a new milestone to learn the new language. Are you excited for the upcoming sessions. Same here I am also excited to share the content on remaining concepts of python.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/0*ihe6pjgOhCEHpCdi" /></figure><p>So, the left-over container Dictionary.</p><h4><strong>Dictionaries:</strong></h4><p>Dictionaries are collection of key-value pairs where multiple values can be mapped to a single key unlike other languages.</p><pre>#creating dictionary<br>dict_1={1:&quot;python&quot;, 2:&quot;is&quot;, 3:&quot;an&quot;, 4:&quot;interactive&quot;, 5:&quot;language&quot;}<br>print(dict_1)<br>#adding dictionary to the dictionary<br>dict_1[6] = {1:&quot;most&quot;, 2:&quot;of&quot;,3:&quot;the&quot;, 4:&quot;engineers&quot;, 5:&quot;are&quot;, 6:&quot;DS&quot;}<br>print(dict_1)<br>print(dict_1[1])    #accessing using key<br>#accessing the nested dictionary<br>print(dict_1[6][4])   <br>dict_1.update({7:&quot;Jack&quot;, 8:&quot;is&quot;, 9:&quot;an&quot;, 10:&quot;AI/ML&quot;, 11:&quot;Resource&quot;}) #updating he dictionary with another dictionary<br>print(dict_1)<br>print(dict_1.values())   #accessing all values of a dictionary<br>print(dict_1.get(11))    #to get the element at particular key<br>print(dict_1.keys())     # to get all the keys<br>print(dict_1.pop(3))     #To pop particular key value pair<br>print(dict_1.popitem())   #To pop the last added key value pair<br><br>output:<br>{1: &#39;python&#39;, 2: &#39;is&#39;, 3: &#39;an&#39;, 4: &#39;interactive&#39;, 5: &#39;language&#39;}<br>{1: &#39;python&#39;, 2: &#39;is&#39;, 3: &#39;an&#39;, 4: &#39;interactive&#39;, 5: &#39;language&#39;, 6: {1: &#39;most&#39;, 2: &#39;of&#39;, 3: &#39;the&#39;, 4: &#39;engineers&#39;, 5: &#39;are&#39;, 6: &#39;DS&#39;}}<br>python<br>engineers<br>{1: &#39;python&#39;, 2: &#39;is&#39;, 3: &#39;an&#39;, 4: &#39;interactive&#39;, 5: &#39;language&#39;, 6: {1: &#39;most&#39;, 2: &#39;of&#39;, 3: &#39;the&#39;, 4: &#39;engineers&#39;, 5: &#39;are&#39;, 6: &#39;DS&#39;}, 7: &#39;Jack&#39;, 8: &#39;is&#39;, 9: &#39;an&#39;, 10: &#39;AI/ML&#39;, 11: &#39;Resource&#39;}<br>dict_values([&#39;python&#39;, &#39;is&#39;, &#39;an&#39;, &#39;interactive&#39;, &#39;language&#39;, {1: &#39;most&#39;, 2: &#39;of&#39;, 3: &#39;the&#39;, 4: &#39;engineers&#39;, 5: &#39;are&#39;, 6: &#39;DS&#39;}, &#39;Jack&#39;, &#39;is&#39;, &#39;an&#39;, &#39;AI/ML&#39;, &#39;Resource&#39;])<br>Resource<br>dict_keys([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11])<br>an<br>(11, &#39;Resource&#39;)</pre><p>If you want access to keys and their corresponding values, use the items method:</p><pre>d = {&#39;human&#39;: 2, &#39;dog&#39;: 4, &#39;crow&#39;: 2}<br>for animal, legs in d.items():<br>    print(&#39;A %s has %d legs&#39; % (animal, legs))<br><br>output:<br>A human has 2 legs<br>A dog has 4 legs<br>A crow has 2 legs</pre><h4><strong>Dictionary methods:</strong></h4><p>clear() — Remove all the elements from the dictionary</p><p>copy() — Returns a copy of the dictionary</p><p>get() — Returns the value of specified key</p><p>items() — Returns a list containing a tuple for each key value pair</p><p>keys() — Returns a list containing dictionary’s keys</p><p>pop() — Remove the element with specified key</p><p>popitem() — Removes the last inserted key-value pair</p><p>update() — Updates dictionary with specified key-value pairs</p><p>values() — Returns a list of all the values of dictionary</p><h4><strong>Dictionary comprehensions:</strong></h4><p>We can create Dictionaries like using comprehensions as in list comprehension.</p><pre>nums = [0, 1, 2, 3, 4]<br>multiply_by_2 = {x: x * 2 for x in nums }<br>print(multiply_by_2)<br><br>output:<br>{0: 0, 1: 2, 2: 4, 3: 6, 4: 8}</pre><h4><strong>Exercise:</strong></h4><ol><li>Get the key of a minimum value in the dictionary</li><li>Delete list keys from a dictionary</li><li>Rename key in a dictionary</li><li>merge two python dictionaries into one</li></ol><h4><strong>Conclusions:</strong></h4><p>That’s it for today. Keep learning Keep Practicing. I am happy that you are being consistent in learning. Keep Going.</p><p>Thanks for Reading!!</p><p>If you want to reach out to me for any comments or help:</p><p>yatheeshamadagala@gmail.com</p><p><a href="https://www.linkedin.com/in/yatheesha-madagala-178386157">https://www.linkedin.com/in/yatheesha-madagala-178386157</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a5ca6a3b067" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python — Basic to Advanced-Day3]]></title>
            <link>https://medium.com/@yatheeshamadagala/python-basic-to-advanced-day3-dcdd25ab3e70?source=rss-7340252012c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/dcdd25ab3e70</guid>
            <category><![CDATA[set-operation]]></category>
            <category><![CDATA[sets-in-python]]></category>
            <category><![CDATA[python-tuple-methods]]></category>
            <category><![CDATA[tuples-in-python]]></category>
            <category><![CDATA[containers]]></category>
            <dc:creator><![CDATA[Yatheesha Madagala]]></dc:creator>
            <pubDate>Tue, 08 Nov 2022 01:18:31 GMT</pubDate>
            <atom:updated>2022-11-08T01:19:16.883Z</atom:updated>
            <content:encoded><![CDATA[<h3>Python — Basic to Advanced-Day4</h3><p>Congratulations!! For being consistent. It doesn&#39;t matter how much time, it do matters whether you are spending some time in coding. Keep going. Happy Learning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*ASQmhckI5-dIJ905" /></figure><p>Today we will cover the other type of containers:</p><h4><strong>Tuples:</strong></h4><ul><li>Tuples are similar to lists but list is mutable and tuples are immutable.</li><li>Tuples are represented with ().</li><li>Tuples can be indexed and sliced.</li></ul><pre><em>#creating a blank tuple</em><br><em>#we cannot modify blank tuple also </em><br>blank_tuple<strong>=</strong>()<br>print(blank_tuple)<br><em>#To get type of container</em><br>print(type(blank_tuple))</pre><pre>output:<br>()<br>&lt;class &#39;tuple&#39;&gt;</pre><p>To convert a list into a tuple or a tuple into a list try the following</p><pre><em>#To convert the list into the tuple</em><br>list_1 <strong>=</strong> [1, 2, 3, 4, 5]<br>print(tuple(list_1)) <em>#tuple is an inbuilt function</em><br>print(type(list_1))  <em>#To check list to tuple conversion</em><br>tuple_1 <strong>=</strong> (10, 20, &quot;coders&quot;, 70)<br>print(list(tuple_1))<br>print(type(tuple_1)) <em>#To check tuple to list conversion</em></pre><pre>output:<br>(1, 2, 3, 4, 5)<br>&lt;class &#39;list&#39;&gt;<br>[10, 20, &#39;coders&#39;, 70]<br>&lt;class &#39;tuple&#39;&gt;</pre><h4><strong>slicing:</strong></h4><p>As tuples can be indexed, we can slice it using numbers.</p><pre><em># Slicing of a Tuple</em><br><em># with Numbers</em><br>Tuple_1 <strong>=</strong> tuple(&#39;datascience&#39;)<br> <br><em># Removing First element</em><br>print(&quot;Removal of First Element: &quot;)<br>print(Tuple_1[1:])<br> <br><em># Reversing the Tuple</em><br>print(&quot;\nTuple after sequence of Element is reversed: &quot;)<br>print(Tuple_1[::<strong>-</strong>1])<br> <br><em># Printing elements of a Range</em><br>print(&quot;\nPrinting elements between Range 4-9: &quot;)<br>print(Tuple_1[4:9])</pre><pre>Removal of First Element: <br>(&#39;a&#39;, &#39;t&#39;, &#39;a&#39;, &#39;s&#39;, &#39;c&#39;, &#39;i&#39;, &#39;e&#39;, &#39;n&#39;, &#39;c&#39;, &#39;e&#39;)<br><br>Tuple after sequence of Element is reversed: <br>(&#39;e&#39;, &#39;c&#39;, &#39;n&#39;, &#39;e&#39;, &#39;i&#39;, &#39;c&#39;, &#39;s&#39;, &#39;a&#39;, &#39;t&#39;, &#39;a&#39;, &#39;d&#39;)<br><br>Printing elements between Range 4-9: <br>(&#39;s&#39;, &#39;c&#39;, &#39;i&#39;, &#39;e&#39;, &#39;n&#39;)</pre><h4><strong>Sets:</strong></h4><ul><li>Set is an unordered collection of distinct elements.</li><li>It is represented with {}.</li><li>Set cannot contain duplicate values.</li><li>Set cannot be indexed as it is unordered.</li></ul><pre><em>#creating a set</em><br>set_1 <strong>=</strong> {1, 2, 4, 7, 8}<br>print(type(set_1))<br>print(1 <strong>in</strong> set_1) <em>#To check element is present in set</em><br>print(len(set_1)) <em>#for length of the set</em><br>set_1<strong>.</strong>add(10)     <em>#To add an element to the set</em><br>print(&quot;After adding new element:&quot;, set_1)<br>set_1<strong>.</strong>pop()       <em>#To pop an element in the set</em><br>print(&quot;After popping the element:&quot;, set_1)<br>set_1<strong>.</strong>remove(8)   <em>#To remove the specified element in the list</em><br>print(&quot;After removing the element 8: &quot;, set_1)</pre><pre>output:<br>&lt;class &#39;set&#39;&gt;<br>True<br>5<br>After adding new element: {1, 2, 4, 7, 8, 10}<br>After popping the element: {2, 4, 7, 8, 10}<br>After removing the element 8:  {2, 4, 7, 10}</pre><p>Set operations on two sets:</p><pre><em>#operations on two sets</em><br>set_1 <strong>=</strong> {1, 2}<br>set_2 <strong>=</strong> {1, 2, 3, 4, 5}<br>print(set_1<strong>.</strong>issubset(set_2))    <em>#if set_1 subset of set_2 returns True</em><br>print(set_2<strong>.</strong>difference(set_1))  <em>#Returns the difference elements from set_2</em><br>print(set_1<strong>.</strong>intersection(set_2))<em>#returns common elements in both sets</em><br>print(set_1<strong>.</strong>issuperset(set_2))  <em>#if set_1 is superset of set_2 returns True</em><br>print(set_1<strong>.</strong>union(set_2))       <em>#Retunrs union of set_1 and set_2</em></pre><pre>output:<br>True<br>{3, 4, 5}<br>{1, 2}<br>False<br>{1, 2, 3, 4, 5}</pre><p>Loops:</p><p>We can iterate over sets but we cannot assume the order of the elements as set is unordered.</p><pre>set_1 <strong>=</strong> {&#39;medium&#39;, &#39;is&#39;, &#39;ultimate&#39;}<br><strong>for</strong> idx, str_1 <strong>in</strong> enumerate(set_1):<br>    print(&#39;#%d: %s&#39; <strong>%</strong> (idx <strong>+</strong> 1, str_1))</pre><pre>output:<br>#1: ultimate<br>#2: medium<br>#3: is</pre><h4><strong>Set comprehension:</strong></h4><p>Like lists we can use comprehension to reduce the code.</p><pre><em>#set comprehension to add the number with 2</em><br>new_set <strong>=</strong> {i<strong>+</strong>2 <strong>for</strong> i <strong>in</strong> range(10)}<br>print(new_set)</pre><pre>output:<br>{2, 3, 4, 5, 6, 7, 8, 9, 10, 11}</pre><p>That’s it for today. Don’t be nervous it is common when you learn a new language. We need to cross this point of line to be comfortable with the language. Keep reading and practicing.</p><p>Thanks for Reading!!</p><p>If you want to reach out to me for any comments or help:</p><p>yatheeshamadagala@gmail.com</p><p><a href="https://www.linkedin.com/in/yatheesha-madagala-178386157">https://www.linkedin.com/in/yatheesha-madagala-178386157</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dcdd25ab3e70" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python — Basic to Advanced-Day3]]></title>
            <link>https://medium.com/@yatheeshamadagala/python-basic-to-advanced-day3-c37346e2a550?source=rss-7340252012c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/c37346e2a550</guid>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[lists]]></category>
            <category><![CDATA[lists-in-python]]></category>
            <dc:creator><![CDATA[Yatheesha Madagala]]></dc:creator>
            <pubDate>Mon, 07 Nov 2022 01:03:16 GMT</pubDate>
            <atom:updated>2023-09-21T03:56:19.870Z</atom:updated>
            <content:encoded><![CDATA[<h3>Python — Basic to Advanced-Day3</h3><p>Congratulations!! on reaching this point. Keep going till you are not afraid of writing a program in python😊.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/0*TuvpI2xoUqRp_2FQ" /></figure><p>Today i will cover most important topic in python so please buckle up.</p><h4><strong>Containers:</strong></h4><p>Python includes multiple built-in container types:</p><ol><li>Lists</li><li>Tuples</li><li>Dictionaries</li><li>Sets</li></ol><p>I will cover each of this topic in different story as I told this is very important let&#39;s take some time to practice these topics.</p><h4><strong>1.Lists:</strong></h4><ul><li>List is data container where it can contain different kind of datatypes.</li><li>List in python is mutable which can be modified at point of time.</li><li>List is represented with [].</li></ul><pre><strong># Creating a List</strong><br>blank_list = []<br>print(&quot;Blank List: &quot;)<br>print(blank_list)</pre><pre><strong>output:</strong><br>Blank List:  <br>[]</pre><pre><strong>#creating a list with integers</strong><br>integer_list = [1, 2, 3, 4, 5]<br>print(&quot;List with integers: &quot; )<br>print(integer_list)</pre><pre><strong>output:</strong><br>List with integers:<br>[1, 2, 3, 4, 5]</pre><pre><strong>#creating a list with strings</strong><br>strings_list = [&quot;we&quot;, &quot;love&quot;, &quot;python&quot;]<br>print(&quot;List with strings: &quot;)<br>print(strings_list)</pre><pre><strong>output:</strong><br>List with strings: <br>[&#39;we&#39;, &#39;love&#39;, &#39;python&#39;]</pre><pre><strong>#creating a list with different datatypes</strong><br>multi_list = [&quot;I&quot;, &quot;love&quot;, &quot;python&quot;, 3, 4, 5]<br>print(&quot;List with multiple datatypes: &quot;, multi_list)</pre><pre><strong>output:</strong><br>List with multiple datatypes:  [&#39;I&#39;, &#39;love&#39;, &#39;python&#39;, 3, 4, 5]</pre><h4><strong>Operations on list:</strong></h4><p>Following are the operations that can be performed on list. Please read the comments to understand the operation.</p><pre>list_1<strong>=</strong>[1, 2, 3, 4, 5]<br>list_2<strong>=</strong>[10, 20, 30, 40, 50]</pre><pre>list_1<strong>.</strong>append(6)  <em>#To append an element at the last</em><br>print(&quot;append operation: &quot;, list_1)</pre><pre>list_1<strong>.</strong>insert(1, 1.5)   <em>#To insert an element at the specified index position</em><br>print(&quot;insert operation: &quot;, list_1)</pre><pre>list_1<strong>.</strong>extend(list_2)   <em>#To extend a list with another list</em><br>print(&quot;extend operation: &quot;, list_1)</pre><pre>x <strong>=</strong> list_1<strong>.</strong>count(10)    <em>#To count number of specified elements in the list</em><br>print(&quot;count operation: &quot;, x)</pre><pre>list_1<strong>.</strong>sort()     <em>#To sort the elements in ascending order</em><br>print(&quot;sort operation: &quot;, list_1)</pre><pre>y <strong>=</strong> list_1<strong>.</strong>index(30)    <em>#To get the index of the specified element</em><br>print(&quot;index operation: &quot;, y)</pre><pre>list_1<strong>.</strong>pop()      <em>#Pops the last element or pops the element at specified index.</em><br>print(&quot;pop operation: &quot;, list_1)</pre><pre>list_1<strong>.</strong>reverse()  <em>#Reversing the entire list</em><br>print(&quot;reverse operation: &quot;, list_1)</pre><pre>list_1<strong>.</strong>remove(1.5)   <em>#removes the specified element</em><br>print(&quot;remove operation: &quot;, list_1)</pre><pre>list_1<strong>.</strong>clear()    <em>#clears the entire list</em><br>print(&quot;clear operation: &quot;,list_1)</pre><pre><strong>output:</strong><br>append operation:  [1, 2, 3, 4, 5, 6]<br>insert operation:  [1, 1.5, 2, 3, 4, 5, 6]<br>extend operation:  [1, 1.5, 2, 3, 4, 5, 6, 10, 20, 30, 40, 50]<br>count operation:  1<br>sort operation:  [1, 1.5, 2, 3, 4, 5, 6, 10, 20, 30, 40, 50]<br>index operation:  9<br>pop operation:  [1, 1.5, 2, 3, 4, 5, 6, 10, 20, 30, 40]<br>reverse operation:  [40, 30, 20, 10, 6, 5, 4, 3, 2, 1.5, 1]<br>remove operation:  [40, 30, 20, 10, 6, 5, 4, 3, 2, 1]<br>clear operation:  []</pre><h4><strong>Slicing:</strong></h4><p>Slicing is like accessing the elements that we want to perform some operation.</p><pre>#performing slicing operation<br>list_1<strong>=</strong>[1, 2, 3, 4, 5]<br>print(list_1)               <em># Prints [1, 2, 3, 4, 5]</em></pre><pre>print(list_1[1:3])     <em># Get a slice from index 1 to 3 (exclusive)&quot;</em></pre><pre>print(list_1[1:])           <em># Get a slice from index 1 to the end&quot;</em><br>print(list_1[:3])  <em># Get a slice from the start to index 3 (exclusive)&quot;</em><br>print(list_1[:])            <em># Get a slice of the whole list; prints &quot;[0, 1, 2, 3, 4]&quot;</em><br>print(list_1[:<strong>-</strong>1])          <em># Slice indices can be negative; prints &quot;[0, 1, 2, 3]&quot;</em><br>list_1[3:5] <strong>=</strong> [6, 7]        <em># Assign a new sublist to a slice</em><br>print(list_1)               <em># Prints &quot;[0, 1, 8, 9, 4]&quot;</em></pre><pre>output:<br>[1, 2, 3, 4, 5]<br>[2, 3]<br>[2, 3, 4, 5]<br>[1, 2, 3]<br>[1, 2, 3, 4, 5]<br>[1, 2, 3, 4]<br>[1, 2, 3, 6, 7]</pre><h4><strong>Loops:</strong></h4><p>List can be iterated using for loop.</p><pre><em>#looping through the list</em><br>list_1<strong>=</strong>[&quot;Coders&quot;, &quot;are&quot;, &quot;champs&quot;, 1, 3, 5]<br><strong>for</strong> i <strong>in</strong> list_1:<br>    print(i)</pre><pre>output:<br>Coders<br>are<br>champs<br>1<br>3<br>5</pre><h4><strong>List comprehension:</strong></h4><p><strong>List comprehension</strong> is an elegant way to define and create a new list in python. It provides shorter syntax than the traditional syntax.</p><pre>list_1 <strong>=</strong> [1, 2, 3, 4, 5]<br>odd_squares <strong>=</strong> [x <strong>**</strong> 2 <strong>for</strong> x <strong>in</strong> list_1 <strong>if</strong> x <strong>%</strong> 2 <strong>!=</strong> 0]<br>print(odd_squares)</pre><pre>output:<br>[1, 9, 25]</pre><h4><strong>Exercise:</strong></h4><ol><li>Insert a new list into the list and use indexing to print elements in the list</li><li>Swap two elements in the list</li><li>print square of all elements in the list</li></ol><p>Please do comment the code if you try this exercise. If you are getting some errors do not worry paste it in the comments, I will be happy to help you. if you feel clumsy at this point, please take some time to understand the concept and try it out again.</p><h4><strong>Conclusion:</strong></h4><p>As I mentioned this is very very important topic in python. Please take some time to understand the topic and practice multiple exercises on the same.</p><p>Thanks for reading!!</p><p>If you want to reach out to me for any comments or help:</p><p>yatheeshamadagala@gmail.com</p><p><a href="https://www.linkedin.com/in/yatheesha-madagala-178386157">https://www.linkedin.com/in/yatheesha-madagala-178386157</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c37346e2a550" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python — Basic to Advanced-Day2]]></title>
            <link>https://medium.com/@yatheeshamadagala/python-basic-to-advanced-day2-41d18aee0e2f?source=rss-7340252012c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/41d18aee0e2f</guid>
            <dc:creator><![CDATA[Yatheesha Madagala]]></dc:creator>
            <pubDate>Sat, 05 Nov 2022 06:09:31 GMT</pubDate>
            <atom:updated>2022-11-05T06:09:31.425Z</atom:updated>
            <content:encoded><![CDATA[<h3>Python — Basic to Advanced-Day2</h3><p>Congratulations!! you made another step to learn geeks language. Day2 doesn`t mean the consecutive day of day1… it is day2 when you are comfortable with day1. Make sure you completly practice day1 and follow the next story. Hope you had already gone through my first story. If not, please start from there.</p><p><a href="https://medium.com/@yatheeshamadagala/python-basic-to-advanced-day1-fda9b4de83ad">Python — Basic to Advanced-Day1</a></p><h4><strong>Datatypes:</strong></h4><p>In Python there is no need to specify declaration for datatypes as it is dynamically typed language. It consists of all kinds of datatypes like other languages.</p><ol><li><strong>Numbers:</strong> Numbers can be of any type like integer, float, complex. We can check the type of datatype using the inbuilt <strong>type() </strong>function in python.</li></ol><pre><em>#print number datatype</em><br>x<strong>=</strong>10<br>print(&quot;Type of x is:&quot;, type(x))<br>y<strong>=</strong>0.9<br>print(&quot;Type of y is:&quot;, type(y))<br>z<strong>=</strong>3<strong>+</strong>4j<br>print(&quot;Type of z is: &quot;, type(z))</pre><pre>output:<br>Type of x is: &lt;class &#39;int&#39;&gt;<br>Type of y is: &lt;class &#39;float&#39;&gt;<br>Type of z is: &lt;class &#39;complex&#39;&gt;</pre><pre>#can also be written as <br>x, y, z= 10, 0.9, 3+4j<br>print(type(x),type(y),type(z))</pre><pre>output:&lt;class &#39;int&#39;&gt; &lt;class &#39;float&#39;&gt; &lt;class &#39;complex&#39;&gt;<br></pre><p>All arithmetic operations can be performed on number datatypes like</p><pre>#example on arithmetic operations<br>a <strong>=</strong> 5<br>b <strong>=</strong> 2<br>print(&quot;Addition:&quot;, a<strong>+</strong>b)<br>print(&quot;Subtraction:&quot;, a<strong>-</strong>b)<br>print(&quot;multiplication:&quot;, a<strong>*</strong>b)<br>print(&quot;Division:&quot;, a<strong>/</strong>b)<br>print(&quot;Modulus:&quot;, a<strong>%b</strong>)<br>print(&quot;Exponentiation:&quot;, a<strong>**</strong>b)</pre><pre>output:<br>Addition: 7<br>Subtraction: 3<br>multiplication: 10<br>Division: 2.5<br>Modulus: 1<br>Exponentiation: 25</pre><p><strong>2. Strings &amp; Characters:</strong> There is no specific char data type in python. A string with single character is defined as char datatype.</p><pre>#print string datatype<br>string_1 <strong>=</strong> &quot;Coders World&quot; #strings can use &#39;&#39; or &quot;&quot;<br>print(&quot;Type of string_1:&quot;, type(string_1))<br>string_2 <strong>=</strong> &quot;C&quot;<br>print(&quot;Type of string_2:&quot;, type(string_2))</pre><pre>output:<br>Type of string_1: &lt;class &#39;str&#39;&gt;<br>Type of string_2: &lt;class &#39;str&#39;&gt;</pre><p>String is immutable in python. We can use slicing on string and access different character. Python has string concatenation and string manipulation etc.</p><p><strong>3.Booleans:</strong> Python also contains Boolean datatype and implement all kind of Boolean logics.</p><pre><em>#print Boolean datatype</em><br>bool_1 <strong>= True</strong><br>bool_2 <strong>= False</strong><br>print(&quot;Type of bool_1:&quot;, type(bool_1))<br>print(&quot;Type of bool_2:&quot;, type(bool_2))</pre><pre>output:<br>Type of bool_1: &lt;class &#39;bool&#39;&gt;<br>Type of bool_2: &lt;class &#39;bool&#39;&gt;</pre><p>Booleans use all kind of logical operators with just English words (and, or, not, xor etc)</p><pre>bool_1 <strong>= True</strong><br>bool_2 <strong>= False</strong><br>print(bool_1 <strong>and</strong> bool_2) <em>#logical and operation</em><br>print(bool_1 <strong>or</strong> bool_2)  <em>#logical or operation</em><br>print(<strong>not</strong> bool_1)        <em>#logical not operation</em><br>print(bool_1 <strong>!=</strong> bool_2 ) <em>#logical xor operation</em></pre><pre>output:<br>False<br>True<br>False<br>True</pre><p>Yes, That`s it for today I will cover Indepth operations on these topics in another tutorial. Programming is not only read and learn… it all comes up with practice, practice and only practice. Please do some exercises daily for a healthy programming😊. Spend a consistent time daily to be a pro.</p><p><strong>Conclusion:</strong></p><p>Congratulations!! you have reached a milestone. Please feel free to reach out to me for any doubts or clarifications. Happy to help.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*58cMgt1Q-rDeMHr3.gif" /></figure><p>If you want to reach out to me for any comments or help:</p><p>yatheeshamadagala@gmail.com</p><p><a href="https://www.linkedin.com/in/yatheesha-madagala-178386157">https://www.linkedin.com/in/yatheesha-madagala-178386157</a></p><p>Please do follow, Like and Share if you like the story, it may also help others.</p><p>Thanks for reading!!❤️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41d18aee0e2f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python — Basic to Advanced-Day1]]></title>
            <link>https://medium.com/@yatheeshamadagala/python-basic-to-advanced-day1-fda9b4de83ad?source=rss-7340252012c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/fda9b4de83ad</guid>
            <category><![CDATA[introduction-to-python]]></category>
            <category><![CDATA[python-web-developer]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[python-programming]]></category>
            <dc:creator><![CDATA[Yatheesha Madagala]]></dc:creator>
            <pubDate>Fri, 04 Nov 2022 08:30:26 GMT</pubDate>
            <atom:updated>2023-09-21T03:46:54.679Z</atom:updated>
            <content:encoded><![CDATA[<h3>Python — Basic to Advanced-Day1</h3><p>Congratulations!!! For starting your journey towards Python/Data Science or AI/ML. So obviously for any Data Science or AI/ML project… Python is the ultimate thing one should learn. Let&#39;s make this journey more beautiful along with me in learning, practicing and much more. Wish you very all the best. Let&#39;s Begin!!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*mxede-q-VcwtZFF8" /></figure><h4><strong>What is Python??</strong></h4><p>python is a programming language that combines the features of C and Java. It offers both structured and object-oriented programming styles. Python is developed by Guido Van Rossum in 1991 and named it python because of his Favorite TV show Monty Python`s Flying Circus.</p><h4><strong>Why Python??</strong></h4><p>As we know it is one of the trending topic in current industry😍. Along with that</p><p><strong>Simple:</strong> More clarity and less stress on understanding &amp; developing. It is highly productive, elegant, simple, yet powerful.</p><p><strong>Open Source:</strong> No need to pay for python software.</p><p><strong>Dynamically typed: </strong>Need not to declare anything</p><p><strong>Huge Library: </strong>consists huge library which can be used on any operating system.</p><p>and many more comes into this list……</p><h4><strong>Installation:</strong></h4><p>It&#39;s very easy and self-explanatory next-next process. Download the version you want from <a href="https://www.python.org/downloads/">https://www.python.org/downloads</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/978/1*bn-GWoCzeymE3czqygoUvQ.png" /></figure><p>Please verify the installation in command prompt by typing</p><pre>python --version</pre><p>if it works it will give the existing version... if it&#39;s not it will give an error command is not recognized. In the failure case add your python path to the environment variables which solves the problem.</p><h4><strong>Editors:</strong></h4><p>Many editor tools available for free you can use anyone based on your interest.</p><ul><li>PyCharm community</li><li>VS code</li><li>Visual Studio</li><li>Anaconda</li><li>Basic python IDLE</li><li>command prompt</li></ul><p>Online tools- Jupyter Notebook, Google Colab etc</p><p>Personal Opinion- VS code is good for learners to professionals.</p><h4><strong>Syntax:</strong></h4><p><strong>#</strong> — for commenting the line of code</p><p><strong>“” or ‘’</strong>—Double quotes or single quotes used to define the strings/characters</p><p><strong>“”” “”” </strong>— triple quotes for multiline comments</p><p><strong>=</strong> — assignment operator</p><p><strong>; </strong>— not required at the end of statement</p><p><strong>Indentation(spaces)</strong> — Required to define a block of code</p><p><strong>:</strong> — Conditional Statements and loops expect indentation will end with this</p><p><strong>def </strong>— To define a method</p><p><strong>class</strong> — To define the class</p><p><strong>import </strong>— for importing the libraries into current module</p><p><strong>print </strong>— for printing the expected output</p><p><strong>help </strong>— To know about any function in python</p><p><strong>.py</strong>- to save the file as python file</p><h4><strong>Let`s begin with our traditional program:</strong></h4><pre>#Print hello world<br>print(&quot;Hello World!!&quot;)</pre><p>O/P: Hello World!!</p><h4><strong>Conclusion:</strong></h4><p>Congratulations!! you have reached a milestone. Please be consistent in learning and programming definitely you will be a pro in 30 days. Don`t worry if you feel uncomfortable at this point of time. you will feel better in next few days.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*9ljQ3yGXplJc4rVy.gif" /></figure><p>Thanks for reading. Hope you liked the story. Please follow regularly as I will be posting this short stories continuously so we will not miss the flow as I will be publishing the series on python.</p><p>If you want to reach out to me for any comments or help:</p><p>yatheeshamadagala@gmail.com</p><p><a href="https://www.linkedin.com/in/yatheesha-madagala-178386157">https://www.linkedin.com/in/yatheesha-madagala-178386157</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fda9b4de83ad" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>