<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jay</title>
    <description>The latest articles on DEV Community by Jay (@nandu).</description>
    <link>https://dev.to/nandu</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F282713%2F3eb5289b-edfb-4556-aa9e-a5d1d43229de.jpg</url>
      <title>DEV Community: Jay</title>
      <link>https://dev.to/nandu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nandu"/>
    <language>en</language>
    <item>
      <title>Sets</title>
      <dc:creator>Jay</dc:creator>
      <pubDate>Wed, 21 Oct 2020 01:42:05 +0000</pubDate>
      <link>https://dev.to/nandu/sets-56fg</link>
      <guid>https://dev.to/nandu/sets-56fg</guid>
      <description>&lt;p&gt;Sets are lists with no duplicate entries.&lt;br&gt;
Since the rest of the sentence uses words which are already in the set, they are not inserted twice.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print(set("I want it Pronto and I am late".split()))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sets are huge importance. When look for differences and intersections between other sets.  For example, say you have a list of participants in events A and B:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a = set(["or", "ni", "car"])
print(a)
b = set(["oui", "non"])
print(b)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To find out which members attended both events, you may use the "intersection" method:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a = set(["or", "ni", "car"])

b = set(["oui", "non"])


print(a.intersection(b))
print(b.intersection(a))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To find out which members attended only one of the events, use the "symmetric_difference" method:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a = set(["or", "ni", "car"])

b = set(["oui", "non"])


print(a.symmetric_difference(b))
print(b.symmetric_difference(a))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To find out which members attended only one event and not the other, use the "difference" method:&lt;br&gt;
To receive a list of all participants, use the "union" method:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a = set(["or", "ni", "car"])
b = set(["oui", "non"])

print(a.union(b))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Break</title>
      <dc:creator>Jay</dc:creator>
      <pubDate>Wed, 21 Oct 2020 00:07:37 +0000</pubDate>
      <link>https://dev.to/nandu/break-148h</link>
      <guid>https://dev.to/nandu/break-148h</guid>
      <description>&lt;h1&gt;
  
  
  break is used to exit a for loop or a while loop, whereas continue is used to skip the current function, and return to the "for" or "while"statement.
&lt;/h1&gt;

&lt;p&gt;e.g:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;count = 0
while True:
    print(count)
    count += 3
    if count &amp;gt;= 7:
        break
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;continue
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for x in range(1,20,4):
    # Check if x is even
    if x % 2 == 0:
        continue
    print(x)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>range</title>
      <dc:creator>Jay</dc:creator>
      <pubDate>Tue, 20 Oct 2020 23:56:28 +0000</pubDate>
      <link>https://dev.to/nandu/range-9en</link>
      <guid>https://dev.to/nandu/range-9en</guid>
      <description>&lt;p&gt;The range of a function is domain beginning with x to and end point y.&lt;br&gt;
e.g: P(x,y) &lt;/p&gt;

&lt;p&gt;As the term "range" can have different meanings, it is considered a good practice to define it the first time it is used in a textbook or article. Older books, when they use the word "range", tend to use it to mean what is now called the codomain. &lt;/p&gt;

&lt;p&gt;Create a &lt;em&gt;sequence of numbers&lt;/em&gt; from 2 to 2, but increment by 3 instead of 1:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for n in range(2, 12, 3):
    print(n)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The formula is&lt;/p&gt;

&lt;p&gt;for variable in range(start, end, increment) you should&lt;br&gt;
     print(variable)&lt;/p&gt;

</description>
    </item>
    <item>
      <title>range</title>
      <dc:creator>Jay</dc:creator>
      <pubDate>Tue, 20 Oct 2020 22:27:42 +0000</pubDate>
      <link>https://dev.to/nandu/range-hje</link>
      <guid>https://dev.to/nandu/range-hje</guid>
      <description>&lt;p&gt;Create a &lt;em&gt;sequence of numbers&lt;/em&gt; from 2 to 2, but increment by 3 instead of 1:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for n in range(2, 12, 3):
    print(n)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The formula is&lt;/p&gt;

&lt;p&gt;for variable in range(start, end, increment) you should&lt;br&gt;
     print(variable)&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Control Flow</title>
      <dc:creator>Jay</dc:creator>
      <pubDate>Tue, 20 Oct 2020 21:59:30 +0000</pubDate>
      <link>https://dev.to/nandu/control-flow-3edl</link>
      <guid>https://dev.to/nandu/control-flow-3edl</guid>
      <description>&lt;p&gt;Create a simple a list. And let python iterate it.&lt;/p&gt;

&lt;p&gt;One quick way of mastering data in the database.&lt;/p&gt;

&lt;p&gt;'''&lt;br&gt;
seasons = ['Winter', 'Spring', 'Summer', 'Fall']&lt;br&gt;
for season in seasons:&lt;br&gt;
        print(season)&lt;/p&gt;

&lt;p&gt;print('In Toronto, we are in' + ': ' + season)&lt;br&gt;
'''&lt;/p&gt;

</description>
    </item>
    <item>
      <title>And</title>
      <dc:creator>Jay</dc:creator>
      <pubDate>Mon, 19 Oct 2020 23:08:51 +0000</pubDate>
      <link>https://dev.to/nandu/and-56m6</link>
      <guid>https://dev.to/nandu/and-56m6</guid>
      <description>&lt;p&gt;Python has three Boolean operators that are typed out as plain English words: and.&lt;br&gt;
It is on main keyword in python. It is based around Boolean algebra in order of find the truth value of expressions. Depending on the truth value, you can evaluate conditions and decide what operations your programs will execute.&lt;br&gt;
e.g.: (a==true and b==true) is true.&lt;br&gt;
On the other hand, while loops allow you to repeat a piece of code if a given condition remains true.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
