<?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 Sayeeda Saneeya Iqbal on Medium]]></title>
        <description><![CDATA[Stories by Sayeeda Saneeya Iqbal on Medium]]></description>
        <link>https://medium.com/@s.saneeya.iqbal?source=rss-7a7715eb6a1b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*IFSU-ja5YrVoDDVeucUT2g.jpeg</url>
            <title>Stories by Sayeeda Saneeya Iqbal on Medium</title>
            <link>https://medium.com/@s.saneeya.iqbal?source=rss-7a7715eb6a1b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 05:28:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@s.saneeya.iqbal/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[Day 15 Tarzan Skills]]></title>
            <link>https://medium.com/@s.saneeya.iqbal/day-15-tarzan-skills-8f70d0c17f99?source=rss-7a7715eb6a1b------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f70d0c17f99</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Sayeeda Saneeya Iqbal]]></dc:creator>
            <pubDate>Fri, 11 Oct 2019 10:09:48 GMT</pubDate>
            <atom:updated>2019-10-11T10:27:49.058Z</atom:updated>
            <content:encoded><![CDATA[<h4>Exceptions Handling</h4><h4><strong>Exception Handling</strong></h4><p>An exception is an error that happens during the execution of a program.</p><p>An exception is a python object that represents an error.</p><p>Exception handling is a construct in some programming languages to handle or deal with errors automatically.</p><pre>Syntax:</pre><pre>try:<br> Your operations are done here</pre><pre>except Exception 1:<br> If there is exception 1, then execute this block.</pre><pre>except Exception 2:<br> If there is exception 1, then execute this block.</pre><pre>else:<br> If there is no exception then execute this block.</pre><pre>finally:<br> This block will always be executed.</pre><h4>Argument of an Exception</h4><p>An exception can have an argument, which is a value that gives additional information about the problem.</p><p>The contents of the argument vary by exception.</p><p>You capture an exception’s argument by supplying a variable in the except clause.</p><pre>Syntax:</pre><pre>try:<br> Your operations are done here</pre><pre>except ExceptionType as Argument:<br> you can print the value of argument here</pre><h4>The except clause with No exceptions</h4><p>This kind of a try-except statement catches all the exceptions that occur.</p><p>Using this kind of try-except statement is not considered a good programming practice though, because it catches all exceptions but does not make the programming identify the root cause of the problem that may occur.</p><pre>try:<br> Your operations are done here.</pre><pre>except:<br> If there is any exception,the execute this block</pre><pre>else:<br> If there is no exception then execute this block</pre><h4><strong>Raising an Exception</strong></h4><p>You can raise exceptions in several ways by using the raise statement.</p><pre>raise [Exception[, args[, traceback]]] </pre><h4>User-Defined Exceptions</h4><p>Python allows user to create his own exceptions by deriving classes from the standard built-in exceptions.</p><pre>try:<br>   raise Networkerror(&quot;Bad hostname&quot;)<br>except Networkerror,e:<br>   print e.args</pre><h4><strong>Datetime</strong></h4><p>The datetime module supplies classes for manipulating dates and ties in both simple and complex ways.</p><p>There are two kinds of date and time objects; naive and aware.</p><h4><strong>Naive</strong></h4><p>A naive object does not contain enough information to unambiguously locate itself relative to other date/time objects.</p><h4><strong>Aware</strong></h4><p>An aware object is used to represent a specific moment in time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f70d0c17f99" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 14 Tarzan Skills]]></title>
            <link>https://medium.com/@s.saneeya.iqbal/day-14-tarzan-skills-9401adad4ea3?source=rss-7a7715eb6a1b------2</link>
            <guid isPermaLink="false">https://medium.com/p/9401adad4ea3</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[modules]]></category>
            <dc:creator><![CDATA[Sayeeda Saneeya Iqbal]]></dc:creator>
            <pubDate>Fri, 27 Sep 2019 08:43:04 GMT</pubDate>
            <atom:updated>2019-09-27T08:43:04.798Z</atom:updated>
            <content:encoded><![CDATA[<h4>Python Modules</h4><p>Every programming language or the work to be done has its own modules. Modules are simply list of some work to be done that is split in small parts.</p><p>Modular programming is the process of breaking a large, unwieldy programming task into separate, smaller sub-tasks or modules.</p><h4>Advantages of Modularizing</h4><ol><li>Simplicity</li><li>Maintainability</li><li>Re-usability</li><li>Scoping</li></ol><h3>Python Modules</h3><p>There are three different ways to define a module in python.</p><ol><li>A module can be written in python itself.</li><li>A module can be written in C and loaded dynamically at run-time like RegEx module.</li><li>A built-in is intrinsically contained in the interpreter like the iterator modules.</li></ol><h3>The Module search path</h3><pre>import mod</pre><p>When the interpreter executes the above import statement, it searches for mod.py in a list of directories assembled from the following sources.</p><ol><li>The directory from which the input script was run or the current directory if the interpreter is being run interactively.</li><li>The list of directories contained in the PYTHONPATH environment variable,if it is set.</li><li>An installation-dependent list of directories configured at the time Python is installed.</li></ol><h4>The import Statement</h4><p>Module contents are made available to the caller with the import statement.</p><pre>import &lt;module_name&gt;</pre><pre>import fibnocci</pre><p>An alternate form of the import statement allows individual objects from the module to be imported directly into the caller’s symbol table.</p><pre>from &lt;module_name&gt; import module</pre><pre>from fibnocci import fib1</pre><p>It is also possible to import individual objects but enter them into the local symbol table with alternate names</p><pre>from &lt;module_name&gt; import &lt;name&gt; as &lt;alt_name&gt;</pre><pre>from fibnocci import fib1 as f</pre><p>That’s all with the python modules</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9401adad4ea3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 13 Tarzan Skills]]></title>
            <link>https://medium.com/@s.saneeya.iqbal/day-13-tarzan-skills-afd2c7ce021d?source=rss-7a7715eb6a1b------2</link>
            <guid isPermaLink="false">https://medium.com/p/afd2c7ce021d</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Sayeeda Saneeya Iqbal]]></dc:creator>
            <pubDate>Thu, 26 Sep 2019 16:30:33 GMT</pubDate>
            <atom:updated>2019-09-26T16:30:33.687Z</atom:updated>
            <content:encoded><![CDATA[<h4>Super( )</h4><p>Firstly as I told in the last blog that we will discuss about the super function in the next blog .</p><p>To know the use of super lets know first about why is inheritance needed.</p><h4>Inheritance?</h4><p>Inheritance is basically used to indicate that one class will get most or all of its features from its parent class.</p><p>This is possible when you have a child class that is derived from its parent class.</p><h4>Reason of super()</h4><p>Multiple inheritance is when you define a class that inherits from one or more classes.</p><pre>Example:<br> <br>class Superfun(child,Badstuff):<br>pass</pre><p>This example is, make a class called superfun that inherits from the classes child and badstuff at the same time.</p><p>Whenever there is implicit actions on any specific Superfun instance. Python has to look up the possible function of the class hierarchy for both child and the badstuff but should be done in the consistent order.</p><p>To do this, python uses “Method Resolution Order”(MRO) and and algorithm called C3 to get it straight.</p><p>All this are complex so python gives us super() function which handles all these for us in the places we need the altering type of actions in child.</p><h4>Using super() with init</h4><p>The most common use of super() is actually in init functions in base classes.</p><pre>example:<br>class child(Parent):<br>def __init__(self,stuff):<br>self.stuff=stuff<br>super(child.self)__init__()</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=afd2c7ce021d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 5 Tarzan Skills]]></title>
            <link>https://medium.com/@s.saneeya.iqbal/day-5-tarzan-skills-15a4f531f3ca?source=rss-7a7715eb6a1b------2</link>
            <guid isPermaLink="false">https://medium.com/p/15a4f531f3ca</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Sayeeda Saneeya Iqbal]]></dc:creator>
            <pubDate>Thu, 26 Sep 2019 15:57:24 GMT</pubDate>
            <atom:updated>2019-09-26T15:57:24.455Z</atom:updated>
            <content:encoded><![CDATA[<h3>Loops</h3><p>Hello….!</p><p>Today we have learnt the next part of statements.</p><h3>For Loop</h3><p>This is used to execute a code repeatedly based on the loop counter or variable.</p><p>For loops are mostly used when the number of iteration is known before entering the loop.</p><pre>Syntax:</pre><pre>for [iterating variable] in [sequence ]:</pre><pre>[do something ]</pre><pre>Ex: for i in range(0,5):</pre><pre>Print (i)</pre><pre>This gives the output as<br>0</pre><pre>1</pre><pre>2</pre><pre>3</pre><pre>4</pre><p><strong>range()</strong></p><p>Range is a python built in immutable sequence of type.</p><p>Range is used to control how many times the loop will be repeated.</p><p>Range accepts 3 arguments, that is start, end and step</p><pre>range(start, end, step)</pre><pre>Ex: for i in range(0,15,3):</pre><pre>Print (i)</pre><pre>This gives the output as,</pre><pre>0</pre><pre>3</pre><pre>6</pre><pre>9</pre><pre>12</pre><pre>Range starts from 0 and end at 15 with a step value of 3.</pre><p>If the step value is negative, then the range is printed in reverse.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15a4f531f3ca" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 4 Tarzan Skills]]></title>
            <link>https://medium.com/@s.saneeya.iqbal/day-4-tarzan-skills-fc8ecd0f6fc9?source=rss-7a7715eb6a1b------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc8ecd0f6fc9</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Sayeeda Saneeya Iqbal]]></dc:creator>
            <pubDate>Tue, 24 Sep 2019 07:25:01 GMT</pubDate>
            <atom:updated>2019-09-26T16:12:55.538Z</atom:updated>
            <content:encoded><![CDATA[<h4>Conditional statements</h4><p>Hello all..!</p><p>Today it was about the flow control of statements. Flow Control is the order in which individual statements, instructions or function calls of an imperative program are executed or evaluated.</p><p>The flow control in programming is regulated by conditional statements, loops and function calls.</p><h3>Conditional statements:</h3><h4>If statement</h4><p>It executes the set of statements conditionally, based on the logical expression.</p><pre>Syntax:<br>if expression:<br>   statement_1<br>   statement_2</pre><h4>If .. else statement</h4><p>This has two blocks of code, one following the expression and the other following the else clause.</p><pre>Syntax:<br>if expression :<br>   statement_1<br>   statement_2<br>else :<br>   statement_3<br>   statement_4</pre><h4>If.. elif.. else statement</h4><p>The if-elif-else statement is used to conditionally execute a statement or a block of statements. Conditions can be true or false, execute one thing when the condition is true, something else when the condition is false.</p><pre>Syntax:<br>if expression :<br>   statement_1<br>   statement_2<br>elif expression:<br>   statement_3<br>   statement_4<br>elif expression:<br>   statement_5<br>   statement_6<br>else:<br>   statement_7<br>   statement_8</pre><h4>Nested if.. else statement</h4><p>Nested if-else statement is used when we want to check more than one conditions.</p><pre>Syntax:<br>if expression1 :<br>   if expression2   <br>      statement_3<br>      statement_4<br>   else:<br>      statement_5<br>      statement_6<br>else:<br>   statement_7<br>   statement_8</pre><h4>While loop</h4><p>Loops are used repeatedly execute the code of a block of programs statements.</p><pre>Syntax:<br>while expression:<br>   statement_1<br>   statement_2</pre><h4>While and else statement</h4><p>Both have a block of statements which is only executed when the condition is true.</p><pre>Syntax:<br>while expression:<br>   statement_1<br>   statement_2<br>else:<br>   statement_3<br>   statement_4</pre><h3>Break and Continue</h3><h4>break statement</h4><p>The purpose of using break is to end the execution of the loop or exit a for or a while loop.</p><pre>Syntax<br>while expression1:<br>   statement_1<br>   statement_2<br>   if expression2:<br>      break</pre><h4>Continue statement</h4><p>The continue statement in python returns the control of the beginning of the while loop.</p><pre>Syntax:<br>while expression1:<br>   statement_1<br>   statement_2<br>   if expression2:<br>      continue</pre><p>Thats all for the day!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc8ecd0f6fc9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 13 Tarzan Skills]]></title>
            <link>https://medium.com/@s.saneeya.iqbal/day-13-tarzan-skills-9b025b1b25d6?source=rss-7a7715eb6a1b------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b025b1b25d6</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Sayeeda Saneeya Iqbal]]></dc:creator>
            <pubDate>Mon, 23 Sep 2019 10:59:02 GMT</pubDate>
            <atom:updated>2019-09-28T03:28:02.990Z</atom:updated>
            <content:encoded><![CDATA[<h3>Day 12 <a href="https://medium.com/u/ac724df62bd0">Tarzan Skills</a></h3><h4>Examples for creating classes,objects and its instances</h4><p>Today in this blog we will learn some examples of creating the object and classes and making their methods and instances.</p><h4>Example 1 : T o display the full name of employee.</h4><pre>class Employee:</pre><pre>def __init__(self,id,f_name,l_name,designation,pay,email):        self.id=id        <br>self.f_name=f_name        <br>self.l_name=l_name        <br>self.designation=designation        <br>self.pay=pay        <br>self.email=email</pre><pre>def fullname(self):        <br>return(self.f_name +&quot; &quot;+self.l_name)</pre><pre>class Developer(Employee):    <br>pass</pre><pre>Saneeya=Developer(2,&quot;Saneeya&quot;,&quot;Iqbal&quot;,&quot;Manager&quot;,&quot;60000&quot;,&quot;saneeya@gmail.com&quot;)<br>print(Saneeya.fullname())<br>print(Employee.fullname(Saneeya))<br>print(Developer.fullname(Saneeya))</pre><p>In the above example, we create class Employee which is the parent class and another class called Developer which is the child class.</p><p>Developer inherits the attributes of the Employee class and becomes the derived class.</p><h4>Example 2 : To show the details of the Staff in a institution</h4><pre>class Staff:</pre><pre>def __init__(self,id,name,number,pay,gender,subject,student_name):        self.id=id        <br>self.name=name        <br>self.number=number        <br>self.pay=pay        <br>self.gender=gender        <br>self.subject=subject        <br>self.student_name=student_name</pre><pre>def show(self):        <br>return(self.name)</pre><pre>class Teacher(Staff):    <br>pass</pre><pre>def teaches(self):        <br>return(self.subject)</pre><pre>class Principal(Staff):    <br>pass</pre><pre>def restigates(self):        <br>return(self.student_name)</pre><pre>Varun=Staff(1,&quot;Varun&quot;,9855654556,7898,&quot;M&quot;,&quot;OOP&quot;,&quot;saniya&quot;)</pre><pre>Saurabh=Teacher(2,&quot;SAurabh&quot;,9855654556,7898,&quot;M&quot;,&quot;OOP&quot;,&quot;priti&quot;)</pre><pre>Saniya= Principal(3,&quot;varun&quot;,7267673,7676,&quot;F&quot;,&quot;OOP&quot;,&quot;priti&quot;)</pre><pre>print(Varun.show())</pre><pre>print(Saurabh.teaches())</pre><pre>print(Saniya.restigates())</pre><pre>#print(Varun.teaches())</pre><p>Let’s end with these simple examples and see you in next blog with more of object oriented programming concept in python and also with a new topic.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b025b1b25d6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 11 Tarzan Skills]]></title>
            <link>https://medium.com/@s.saneeya.iqbal/day-12-tarzan-skills-74ec3e09edbb?source=rss-7a7715eb6a1b------2</link>
            <guid isPermaLink="false">https://medium.com/p/74ec3e09edbb</guid>
            <dc:creator><![CDATA[Sayeeda Saneeya Iqbal]]></dc:creator>
            <pubDate>Fri, 20 Sep 2019 02:40:59 GMT</pubDate>
            <atom:updated>2019-09-26T16:09:24.408Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>Object Oriented Programming</strong></h4><p>Today’s topic is about the OOP concept in Python</p><p>Python is a object oriented language, everything in python is an object</p><p>An object has two characteristics:</p><ul><li>Attributes</li><li>Behaviour</li></ul><p>The process of creating objects is called instantiation.</p><h4>Class</h4><p>A class is a blue print for the object.</p><pre>Example:</pre><pre>class parrot:<br>pass</pre><ul><li>Parrot is the name of the class.</li></ul><h4>Object</h4><p>Object is simply a collection of data(variables) and methods(functions) that acts on those data.</p><p>An object (instance) is an instantiation of a class.</p><h4>Method</h4><p>Methods are functions defined inside the body of a class.</p><p>They are used to define the behaviours of an object.</p><pre>Example:</pre><pre>Class parrot:</pre><pre>#instance attributes<br>def __init__(self, name, age) :<br>self.name=name<br>self.age=age</pre><pre>#instance method<br>def sing(self, song) :<br>return “{} sings {}”.format(self.name, song)</pre><pre>def dance (self) :<br>return “{} is now dancing”.format(self.name)</pre><pre>#instantiate the object<br>Blu=Parrot(“Blu”, 10)<br>print(Blu.sing(“Happy”))<br>print(Blu.dance())</pre><h4>Constructors</h4><p>Class functions that begins with double underscore (__) are called special functions as they have special meaning.</p><p>This special function gets called whenever a new object of that class is instantiated.</p><pre>Example:<br>#definition of the class starts here  <br>class Person:  <br>    #initializing the variables  <br>    name = &quot;&quot;  <br>    age = 0  <br>      <br>    #defining constructor  <br>    def __init__(self, personName, personAge):  <br>        self.name = personName  <br>        self.age = personAge  <br>  <br>    #defining class methods  <br>    def showName(self):  <br>        print(self.name)  <br>  <br>    def showAge(self):  <br>        print(self.age)  <br>          <br>    #end of the class definition  <br>  <br># Create an object of the class  <br>person1 = Person(&quot;Richard&quot;, 23)  <br>#Create another object of the same class  <br>person2 = Person(&quot;Anne&quot;, 30)  </pre><pre>#call member methods of the objects  <br>person1.showAge()  <br>person2.showName()</pre><h3>Encapsulation</h3><ul><li>Hiding the private details of a class from other objects</li><li>We can restrict access to methods and variables</li><li>This prevent data from direct modification which is called encapsulation.</li></ul><pre>Example:<br><br>class Car:<br><br>    __maxspeed = 0<br>    __name = &quot;&quot;<br>    <br>    def __init__(self):<br>        self.__maxspeed = 200<br>        self.__name = &quot;Supercar&quot;<br>    <br>    def drive(self):<br>        print(&#39;driving. maxspeed &#39; + str(self.__maxspeed))<br><br>redcar = Car()<br>redcar.drive()<br>redcar.__maxspeed = 10  # will not change variable because its private<br>redcar.drive()</pre><h3>Inheritance</h3><ul><li>A process of using details from a new class without modifying existing class.</li><li>The newly formed class is a derived class (child class)</li><li>The existing class is a base class (parent class)</li></ul><pre>Example:</pre><pre># A Python program to demonstrate inheritance</pre><pre># Base or Super class. Note object in bracket. <br># (Generally, object is made ancestor of all classes) <br># In Python 3.x &quot;class Person&quot; is <br># equivalent to &quot;class Person(object)&quot; <br>class Person(object): <br> <br> # Constructor <br> def __init__(self, name): <br>  self.name = name</pre><pre># To get name <br> def getName(self): <br>  return self.name</pre><pre># To check if this person is employee <br> def isEmployee(self): <br>  return False</pre><pre># Inherited or Sub class (Note Person in bracket) <br>class Employee(Person):</pre><pre># Here we return true <br> def isEmployee(self): <br>  return True</pre><pre># Driver code <br>emp = Person(&quot;Geek1&quot;) # An Object of Person <br>print(emp.getName(), emp.isEmployee())</pre><pre>emp = Employee(&quot;Geek2&quot;) # An Object of Employee <br>print(emp.getName(), emp.isEmployee())</pre><h3>Polymorphism</h3><ul><li>A concept of using common operation in different ways for different data input.</li><li>Polymorphism is an ability in OOP to use common interface for multiple form (data types).</li></ul><pre>Example:</pre><pre>class India(): <br> def capital(self): <br>  print(&quot;New Delhi is the capital of India.&quot;)</pre><pre>def language(self): <br>  print(&quot;Hindi the primary language of India.&quot;)</pre><pre>def type(self): <br>  print(&quot;India is a developing country.&quot;)</pre><pre>class USA(): <br> def capital(self): <br>  print(&quot;Washington, D.C. is the capital of USA.&quot;)</pre><pre>def language(self): <br>  print(&quot;English is the primary language of USA.&quot;)</pre><pre>def type(self): <br>  print(&quot;USA is a developed country.&quot;)</pre><pre>obj_ind = India() <br>obj_usa = USA() <br>for country in (obj_ind, obj_usa): <br> country.capital() <br> country.language() <br> country.type()</pre><p>That’s all for today…! We will learn about the use of Super in next blog.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74ec3e09edbb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 10 Tarzan Skills]]></title>
            <link>https://medium.com/@s.saneeya.iqbal/day-11-tarzan-skills-1e451010e003?source=rss-7a7715eb6a1b------2</link>
            <guid isPermaLink="false">https://medium.com/p/1e451010e003</guid>
            <dc:creator><![CDATA[Sayeeda Saneeya Iqbal]]></dc:creator>
            <pubDate>Fri, 20 Sep 2019 02:21:40 GMT</pubDate>
            <atom:updated>2019-09-26T16:08:06.445Z</atom:updated>
            <content:encoded><![CDATA[<h4>Iterators</h4><p>We will learn about iterators and generators in python</p><p>Iterator in python is any python type that can be used with a &#39;for in loop’.</p><p>Any object that wants to be an iterator must implement following methods.</p><p>Python lists, tuples, dicts and sets are all examples of inbuilt iterators.</p><pre>Example:<br>evens=[2,4,6,8,10]<br>eveniterator=iter(evens)<br>eveniterator</pre><h4>Generators</h4><p>A generator-function is defined like a normal function, but whenever it needs to generate a value, it does so with the yield keyword rather than return.</p><p>If the body of a def contains yield, the function automatically becomes a generator function.</p><pre>Syntax:</pre><pre>def counter():<br>i=1<br>while (i&lt;=10):<br>Yield i<br>i+=1<br>for i in counter() :<br>print (i)</pre><pre>It returns all the 10 numbers.</pre><p>That’s all for today..!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e451010e003" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 9 Tarzan Skills]]></title>
            <link>https://medium.com/@s.saneeya.iqbal/day-10-tarzan-skills-5ea0b1ca6275?source=rss-7a7715eb6a1b------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ea0b1ca6275</guid>
            <dc:creator><![CDATA[Sayeeda Saneeya Iqbal]]></dc:creator>
            <pubDate>Mon, 16 Sep 2019 14:03:52 GMT</pubDate>
            <atom:updated>2019-09-26T16:07:10.255Z</atom:updated>
            <content:encoded><![CDATA[<h4>Regular Expressions</h4><p>Today we shall learn about regular expressions.</p><p>Regular expressions are text matching patterns described with a formal syntax referred to as ‘regex’ or ‘regexp’</p><p>These can include a variety of rules,fir finding the repetitions, text-matching.</p><h4>Modules in regular expressions</h4><p>Python has a module named re to work with RegEx</p><pre>Ex: PhonenumRegex=re.compile(r “\d\d\d - \d\d\d-\d\d\d\d”)</pre><pre>Matches=PhonenumRegex. search(‘my number is 415-577-8372.’)</pre><pre>Print(“phone number found”+matches.group())</pre><pre>Output:</pre><pre>Phone number found:415-577+8372</pre><p>Passing a string value representing your regular expressions to re.compile() returns a RegEx pattern object to create a regex object that matches the phone number in your print string</p><h4>Matching regex objects</h4><p>Regex objects search() method searches the string it is passed for any matches to the regex. The search() method will return None if the regex pattern is not found in the string. If the pattern is found, the search() method returns a match object.</p><h4>findall()</h4><p>Finds all the matches and returns them as a list of strings, with each string representing one match.</p><pre>Ex: PhonenumRegex=re.compile(r “\d\d\d - \d\d\d-\d\d\d\d”)</pre><pre>PhonenumRegex. Findall(‘my number is home:415-577-8372 Work:562-727-5858.’)</pre><pre>415-577-8372 562-727-5858</pre><h4>Grouping with Parentheses</h4><p>If you want to separate the area code from the rest of the phone number. Adding parentheses will create groups in regex (“\d\d\d - \d\d\d-\d\d\d\d”)</p><h4>Optional matching with the question mark</h4><p>Sometimes there is a pattern that you want to match only optionally. That is the regex should find a match whether or not that big of text is here.</p><pre>Batregex=re.compile(r“Bat(wo)? Man”)</pre><pre>Mol=Batregex.search(“the adventures of batman”)</pre><pre>Mol.group()</pre><pre>‘Batman’</pre><p>That’s all for today..!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ea0b1ca6275" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 8 Tarzan Skills]]></title>
            <link>https://medium.com/@s.saneeya.iqbal/day-9-tarzan-skills-36f6fe33f5d5?source=rss-7a7715eb6a1b------2</link>
            <guid isPermaLink="false">https://medium.com/p/36f6fe33f5d5</guid>
            <dc:creator><![CDATA[Sayeeda Saneeya Iqbal]]></dc:creator>
            <pubDate>Mon, 16 Sep 2019 02:52:22 GMT</pubDate>
            <atom:updated>2019-09-26T16:04:37.084Z</atom:updated>
            <content:encoded><![CDATA[<h4>Dictionary</h4><p>Today we’ll learn about Dictionary, Tuples and sets.</p><p>Dictionary is like a list, and general. In list the indices have to be integers, in dictionary they can b almost any type.</p><p>Dictionaries are mapping between a set of indices which are called keys and a set of values.</p><p>The association of a key and value is called a key-value pair or sometimes an item.</p><p>The function dict creates a new dictionary with no items. Because dict is the name of a built-in function</p><p>Ex:eng2sp=dict()</p><p>eng2sp gives {}</p><p>The squiggly brackets represents an empty dictionary. To add items to the dictionary we can use square brackets.</p><h4>Tuples</h4><p>A tuple is a sequence of values. The values can be any type, and they are indexed by integers so in that respect tuples are a lot like lists.</p><p>The important difference is that tuples are mutable.</p><p>Ex: t= ‘a’, ‘b’, ‘c’, ‘d’, ‘e’</p><p>t1= ‘a’</p><p>type(t1)</p><p>&lt;class ‘tuple’&gt;</p><h4>Tuple assignment</h4><p>It is often used to swap values of two variables. With conventional assignments, you have to use a temporary variable.</p><p>Ex: temp =a</p><p>a=b</p><p>b=temp</p><h4>Sets</h4><p>Set in python is a data structure equivalent to sets in mathematics. It may consists of various elements the order of elements in a set is undefined.</p><p>Ex: x=set()</p><p>We add to sets with the add() method</p><p>x.add(1)</p><p>x gives {1}</p><p>Add a different element</p><p>x.add(2)</p><p>x gives {1,2}</p><h4>Set union</h4><p>It is performed with ¦ operator</p><p>Ex: x1 ={‘foo’, ‘bar’, ‘baz’}</p><p>x2 ={‘baz’, ‘quiz’, ‘quux’}</p><p>x1 ¦ x2 ={‘foo’, ‘bar’, ‘baz’, ‘quiz’, ‘quux’}</p><h4>Set Intersection</h4><p>It is performed using &amp; operator</p><p>Ex: x1 ={‘foo’, ‘bar’, ‘baz’}</p><p>x2 ={‘baz’, ‘quiz’, ‘quux’}</p><p>x1 &amp; x2 ={‘baz’}</p><p>Thats all for today..!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36f6fe33f5d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>