<?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: Mcvean Soans</title>
    <description>The latest articles on DEV Community by Mcvean Soans (@mctechie).</description>
    <link>https://dev.to/mctechie</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%2F482707%2Fe4af3357-1a7b-4a72-b13a-e972a16964f9.jpeg</url>
      <title>DEV Community: Mcvean Soans</title>
      <link>https://dev.to/mctechie</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mctechie"/>
    <language>en</language>
    <item>
      <title>AutoDL celebrates Hacktoberfest 2021</title>
      <dc:creator>Mcvean Soans</dc:creator>
      <pubDate>Thu, 30 Sep 2021 05:02:14 +0000</pubDate>
      <link>https://dev.to/mctechie/autodl-celebrates-hacktoberfest-2021-25da</link>
      <guid>https://dev.to/mctechie/autodl-celebrates-hacktoberfest-2021-25da</guid>
      <description>&lt;p&gt;At last it's "that time" of the year again! The month of October is right around the corner, and surely you might've already guessed it... 👀&lt;/p&gt;

&lt;p&gt;The much awaited &lt;strong&gt;&lt;a href="https://hacktoberfest.digitalocean.com" rel="noopener noreferrer"&gt;Hacktoberfest&lt;/a&gt;&lt;/strong&gt; is back for the year 2021!&lt;/p&gt;

&lt;p&gt;What's more, &lt;strong&gt;&lt;a href="https://twitter.com/auto_dl" rel="noopener noreferrer"&gt;AutoDL&lt;/a&gt;&lt;/strong&gt; is geared up for participants to contribute as well!&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1441415078494945281-229" src="https://platform.twitter.com/embed/Tweet.html?id=1441415078494945281"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1441415078494945281-229');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1441415078494945281&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;p&gt;Now if you're unaware, Hacktoberfest is &lt;em&gt;&lt;a href="https://www.digitalocean.com/blog/hacktoberfest-is-back-2021" rel="noopener noreferrer"&gt;DigitalOcean&lt;/a&gt;'s&lt;/em&gt; month-long celebration of Open-Source software and communities.&lt;/p&gt;

&lt;p&gt;Code Newbies and Open-Source Connoisseurs alike are all welcome to take up Issues on AutoDL's &lt;a href="https://github.com/Auto-DL/Auto-DL" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; repositories and submit a &lt;em&gt;valid&lt;/em&gt; Pull Request (abiding by the &lt;a href="https://hacktoberfest.digitalocean.com/resources/qualitystandards" rel="noopener noreferrer"&gt;quality standards&lt;/a&gt;) pertaining to close open issues on GitHub.&lt;/p&gt;

&lt;p&gt;P.s. Look for issues with the &lt;code&gt;hacktoberfest&lt;/code&gt; label on it. 😉&lt;/p&gt;

&lt;p&gt;Make &lt;strong&gt;4 valid PRs&lt;/strong&gt; throughout the month to stand a chance to be rewarded with a commemorative t-shirt pack as official swag from DigitalOcean! Additionally, AutoDL would be distributing swags for top contributors in its repositories too! 🤩&lt;/p&gt;

&lt;p&gt;Do make sure to read the &lt;a href="https://github.com/Auto-DL/Auto-DL/blob/v1-beta/CONTRIBUTING.md" rel="noopener noreferrer"&gt;Contributing&lt;/a&gt; guidelines and the &lt;a href="https://github.com/Auto-DL/Auto-DL/blob/v1-beta/CODE_OF_CONDUCT.md" rel="noopener noreferrer"&gt;Code of Conduct&lt;/a&gt; to gain an insight on how to contribute!&lt;/p&gt;

&lt;p&gt;If you feel stuck, need any help, or you need to tackle a different issue not addressed on GitHub entirely, feel free to discuss on AutoDL's &lt;strong&gt;&lt;a href="https://join.slack.com/t/autodl/shared_invite/zt-qagxiwub-ywRM_oBvvF~F7YNtlBqy_Q" rel="noopener noreferrer"&gt;Slack&lt;/a&gt;&lt;/strong&gt; Workspace. ✨&lt;/p&gt;

&lt;p&gt;P.s. There's a separate channel for hacktoberfest as well 😊&lt;/p&gt;

&lt;p&gt;Now, as tantalizing (or lucrative) the perks may sound, remember that as mentioned on the official website of Hacktoberfest -&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Quantity is fun, quality is key&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Quality pull requests showcase you as a responsible member of the Open-Source community! Do utilize this exciting opportunity to contribute, be it your first pull request or your bazillianth one! ✌️&lt;/p&gt;

</description>
      <category>hacktoberfest</category>
      <category>opensource</category>
      <category>codenewbie</category>
      <category>github</category>
    </item>
    <item>
      <title>Mastering Datatypes in Python</title>
      <dc:creator>Mcvean Soans</dc:creator>
      <pubDate>Thu, 26 Nov 2020 10:42:05 +0000</pubDate>
      <link>https://dev.to/mctechie/datatypes-and-mutability-in-python-4266</link>
      <guid>https://dev.to/mctechie/datatypes-and-mutability-in-python-4266</guid>
      <description>&lt;p&gt;This topic might be a bore for non-enthusiasts and beginners alike 😕, but really is quite easy and simple to pick up 🤭. Okay, before you criticize me for my demeanor, let me make it clear that the aim of this post is to &lt;strong&gt;strengthen&lt;/strong&gt; the fundamentals of beginners, and for the experienced folks to brush up on their amazing skills!&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;datatype&lt;/strong&gt;, simply put, represents the type of data stored into a variable, in memory. These may be classified into 2 main categories: &lt;strong&gt;&lt;em&gt;Built-in&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;User-defined&lt;/em&gt;&lt;/strong&gt;. For now, let us focus on built-in datatypes only.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Built-in Datatypes&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Python provides a few built-in data types, which come preloaded when it is installed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;None&lt;/li&gt;
&lt;li&gt;Numeric&lt;/li&gt;
&lt;li&gt;bool&lt;/li&gt;
&lt;li&gt;Sequences&lt;/li&gt;
&lt;li&gt;Sets&lt;/li&gt;
&lt;li&gt;Mappings (Dictionaries)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let us look at each of these in detail! 😄&lt;/p&gt;

&lt;h3&gt;
  
  
  None Type
&lt;/h3&gt;

&lt;p&gt;In Python, the '&lt;em&gt;None&lt;/em&gt;' datatype represents an object which does not contain any value (similar to 'null' in Java). Python being a &lt;a href="https://dev.to/mcscodes/python-preamble-127m"&gt;&lt;strong&gt;dynamically-typed language&lt;/strong&gt;&lt;/a&gt;, '&lt;em&gt;None&lt;/em&gt;' is used less frequently.&lt;/p&gt;

&lt;h3&gt;
  
  
  Numeric Type
&lt;/h3&gt;

&lt;p&gt;These represent numbers, and are further subdivided into:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;int&lt;/em&gt;&lt;/strong&gt; - These represent integers (a number without any decimal point). For example, &lt;code&gt;a = -30&lt;/code&gt; or &lt;code&gt;b = 289&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;float&lt;/em&gt;&lt;/strong&gt; - These represent floating-point numbers (a number containing a decimal point). For example, &lt;code&gt;n = 25.69&lt;/code&gt; or &lt;code&gt;x = 30.26e3&lt;/code&gt;, where '&lt;em&gt;e&lt;/em&gt;' or '&lt;em&gt;E&lt;/em&gt;' represents &lt;em&gt;exponentiation to the power of 10&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;complex&lt;/em&gt;&lt;/strong&gt; - These represent complex numbers written in the form &lt;code&gt;a+bj&lt;/code&gt; or &lt;code&gt;a+bJ&lt;/code&gt;. In this form, '&lt;em&gt;a&lt;/em&gt;' is the real part of the number and '&lt;em&gt;b&lt;/em&gt;' is the coefficient, while '&lt;em&gt;j&lt;/em&gt;' or '&lt;em&gt;J&lt;/em&gt;' is the square root of &lt;em&gt;-1&lt;/em&gt;. For example,&lt;br&gt;
&lt;code&gt;c1 = 1 - 0.5j&lt;/code&gt; or &lt;code&gt;c2 = 2 + 5J&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;🤔 &lt;strong&gt;&lt;em&gt;You may find this interesting too :&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
Python provides facilities to represent &lt;em&gt;Binary&lt;/em&gt;, &lt;em&gt;Octal&lt;/em&gt; and &lt;em&gt;Hexadecimal&lt;/em&gt; numbers too. A binary number should be written with a prefix '&lt;strong&gt;&lt;em&gt;0b&lt;/em&gt;&lt;/strong&gt;' (zero and b) or '&lt;strong&gt;&lt;em&gt;0B&lt;/em&gt;&lt;/strong&gt;' (zero and B), octal numbers with a prefix of '&lt;strong&gt;&lt;em&gt;0o&lt;/em&gt;&lt;/strong&gt;' (zero and o) or '&lt;strong&gt;&lt;em&gt;0O&lt;/em&gt;&lt;/strong&gt;' (zero and O), and hexadecimal numbers with a prefix of '&lt;strong&gt;&lt;em&gt;0x&lt;/em&gt;&lt;/strong&gt;' (zero and x) or '&lt;strong&gt;&lt;em&gt;0X&lt;/em&gt;&lt;/strong&gt;' (zero and X).&lt;/p&gt;
&lt;h3&gt;
  
  
  bool Type
&lt;/h3&gt;

&lt;p&gt;This is a special datatype which represents either "&lt;strong&gt;True&lt;/strong&gt;" or "&lt;strong&gt;False&lt;/strong&gt;". It is used mainly in conditional statements to evaluate conditions and provide a logical answer (&lt;em&gt;True&lt;/em&gt; or &lt;em&gt;False&lt;/em&gt;). Conditional statements will be covered in an upcoming post, but for now we only need to know that they help us decide the flow of control of our program depending on any given condition.&lt;/p&gt;
&lt;h3&gt;
  
  
  Sequences in Python
&lt;/h3&gt;

&lt;p&gt;These may be looked at as a group of elements or items. In Python, we have six types of sequences:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;str&lt;/em&gt;&lt;/strong&gt; - These represent strings (a group of characters) in Python. Strings are enclosed within double or single quotes, and even with triple double quotes or triple single quotes (called &lt;a href="https://dev.to/mcscodes/comments-and-docstrings-in-python-gaf"&gt;&lt;strong&gt;docstrings&lt;/strong&gt;&lt;/a&gt;). For example,&lt;br&gt;
&lt;code&gt;word = "Hello"&lt;/code&gt; or &lt;code&gt;name = "Mack"&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;bytes&lt;/em&gt;&lt;/strong&gt; - These represent a group of byte numbers just like an array. A byte number is any positive number from 0 to 255 (inclusive). For example, &lt;code&gt;x = bytes([0, 10, 20, 30, 40, 50])&lt;/code&gt; creates a bytes array having 6 elements.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;bytearray&lt;/em&gt;&lt;/strong&gt; - This is exactly similar to the &lt;em&gt;bytes&lt;/em&gt; datatype, the only difference being that this datatype is &lt;strong&gt;&lt;em&gt;mutable&lt;/em&gt;&lt;/strong&gt; (the elements of an array, once created, cannot be altered). We will look at &lt;em&gt;mutability&lt;/em&gt; later on so do continue reading! 😁&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;list&lt;/em&gt;&lt;/strong&gt; - Lists in Python are similar to arrays in C or Java, the main difference being a &lt;em&gt;list&lt;/em&gt; is capable of storing multiple types of objects, whereas an &lt;em&gt;array&lt;/em&gt; can only store one type of elements. Hence, we can see that lists are a very important datatype. For example, &lt;br&gt;
&lt;code&gt;names = ['John', 'Roy', 'Michelle', 'Sharon']&lt;/code&gt; or&lt;br&gt;
&lt;code&gt;misc = [1, 'Michael', 23.60, -30]&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;tuple&lt;/em&gt;&lt;/strong&gt; - A &lt;em&gt;tuple&lt;/em&gt; is exactly similar to a &lt;em&gt;list&lt;/em&gt;, the only main difference being that a &lt;em&gt;tuple&lt;/em&gt; is &lt;strong&gt;immutable&lt;/strong&gt; whereas a &lt;em&gt;list&lt;/em&gt; is &lt;strong&gt;mutable&lt;/strong&gt;. Hence, we can say that a &lt;em&gt;tuple&lt;/em&gt; is a &lt;strong&gt;read-only list&lt;/strong&gt;. For example,&lt;br&gt;
&lt;code&gt;names = ('John', 'Roy', 'Michelle', 'Sharon')&lt;/code&gt; or&lt;br&gt;
&lt;code&gt;misc = (1, 'Michael', 23.60, -30)&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;range&lt;/em&gt;&lt;/strong&gt; - These represent a sequence of numbers. Similar to a &lt;em&gt;tuple&lt;/em&gt;, the elements are not modifiable i.e., this datatype is &lt;strong&gt;immutable&lt;/strong&gt;. These are generally used in loops and iterative structures. For example,&lt;br&gt;
&lt;code&gt;r = range(10)&lt;/code&gt;, the variable 'r' stores numbers from &lt;em&gt;0&lt;/em&gt; upto &lt;em&gt;9&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;🤔 &lt;strong&gt;&lt;em&gt;A key takeaway :&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
From the above examples, we can see that a &lt;em&gt;list&lt;/em&gt; encloses elements within opening and closing square / box brackets ('&lt;strong&gt;[&lt;/strong&gt;' and '&lt;strong&gt;]&lt;/strong&gt;'), while a &lt;em&gt;tuple&lt;/em&gt; encloses elements within opening and closing parenthesis ('&lt;strong&gt;(&lt;/strong&gt;' and '&lt;strong&gt;)&lt;/strong&gt;').&lt;/p&gt;
&lt;h3&gt;
  
  
  Sets in Python
&lt;/h3&gt;

&lt;p&gt;A set is an &lt;strong&gt;unordered&lt;/strong&gt; collection of elements. What does this mean? Well, whenever we create a sequence in Python, the order of the elements stays put (fixed). This is not true for sets. Whenever we create a set, the elements may not appear in the same order as they are entered. Moreover, a set &lt;strong&gt;does not accept duplicate elements&lt;/strong&gt;. Sets are again sub-divided into two:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;set&lt;/em&gt;&lt;/strong&gt; - This is similar to an array and uses opening and closing curly brackets ('&lt;strong&gt;{&lt;/strong&gt;' and '&lt;strong&gt;}&lt;/strong&gt;') to store the elements. We can create a &lt;em&gt;set&lt;/em&gt; in two ways, for example, &lt;code&gt;s1 = {1, 2, 3, 4, 5}&lt;/code&gt; or &lt;code&gt;s2 = set("Hello")&lt;/code&gt;. The second method utilizes the '&lt;em&gt;set( )&lt;/em&gt;' function to convert the letters of the string into a set.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;frozenset&lt;/em&gt;&lt;/strong&gt; - It is similar to the &lt;em&gt;set&lt;/em&gt; datatype, the only difference being, &lt;em&gt;frozenset&lt;/em&gt; datatype as the name suggests is &lt;strong&gt;immutable&lt;/strong&gt;, while the &lt;em&gt;set&lt;/em&gt; datatype is &lt;strong&gt;mutable&lt;/strong&gt;. We also have two ways to create a &lt;em&gt;frozenset&lt;/em&gt;, we can first create a set and then pass it thorugh the &lt;em&gt;frozenset( )&lt;/em&gt; function &lt;code&gt;fs1 = frozenset(s1)&lt;/code&gt; or directly pass another object (such as a string) to create a frozenset, &lt;code&gt;fs2 = frozenset("Hello")&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  Mappings (Dictionaries) in Python
&lt;/h3&gt;

&lt;p&gt;A &lt;strong&gt;map&lt;/strong&gt; represents a group of elements in the form of &lt;strong&gt;key-value pairs&lt;/strong&gt;. Understanding dictionaries in Python is pretty simple.&lt;/p&gt;

&lt;p&gt;Imagine you are given a particular word (say "Photosynthesis") with a dictionary in hand, and you are said to locate the meaning of the word using the dictionary. Logically, we would start searching for the meaning, by first looking up the letters (starting from the first all the way upto the last one) until we find the word (starting from "P" in our case, followed by "h", "o", and all the way upto "s"). This way, we are able to quickly locate the meaning without having to look at the meaning of each and every word in the dictionary. In this case the word is considered as the "&lt;strong&gt;key&lt;/strong&gt;" and the meaning is considered as the "&lt;strong&gt;value&lt;/strong&gt;"&lt;/p&gt;

&lt;p&gt;Similarly, the '&lt;strong&gt;&lt;em&gt;dict&lt;/em&gt;&lt;/strong&gt;' datatype in Python is utilized to store key-value pairs. The &lt;em&gt;keys&lt;/em&gt; and &lt;em&gt;values&lt;/em&gt; are separated using a colon (&lt;strong&gt;:&lt;/strong&gt;) and every &lt;em&gt;key-value pair&lt;/em&gt; is separated using a comma (&lt;strong&gt;,&lt;/strong&gt;). Finally, all the elements are to be enclosed within curly brackets (&lt;strong&gt;{ }&lt;/strong&gt;).&lt;/p&gt;

&lt;p&gt;Also, dictionaries are &lt;strong&gt;mutable&lt;/strong&gt; and hence the elements stored in the dictionaries can be altered. For example,&lt;br&gt;
&lt;code&gt;roll = {1: "Aaron", 2: "Adele", 3: "Mike", 4: "Ryan"}&lt;/code&gt; or &lt;code&gt;d = {}&lt;/code&gt; is an empty dictionary.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Mutability&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;It is a property of an &lt;strong&gt;object&lt;/strong&gt; by which it's elements can be altered after creation. Let us take a look at the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;lst = [1,2,3,4,5] # A list of 5 elements
print(lst) # [1,2,3,4,5] is printed
lst[0] = 10 # Changing value at index 0
print(lst) # [10,2,3,4,5] is printed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From the above code, we can make out that the value of the first element in the list (at index 0) was changed from '1' to '10'. We were able to do this because as we have seen earlier, &lt;em&gt;lists&lt;/em&gt; are &lt;strong&gt;mutable&lt;/strong&gt;. Finally, let us look at another example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tup = (1,2,3,4,5) # A tuple of 5 elements
tup[0] = 10 # Throws an error on the screen
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As we can see, the second statement throws an error. Why is that? It is because &lt;em&gt;tuples&lt;/em&gt; (similar to &lt;em&gt;frozenset&lt;/em&gt; and &lt;em&gt;bytes&lt;/em&gt;) are &lt;strong&gt;immutable&lt;/strong&gt;. Any attempt to alter the elements, once the object has been created, is simply not allowed.&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>How Python Sees Variables</title>
      <dc:creator>Mcvean Soans</dc:creator>
      <pubDate>Thu, 26 Nov 2020 04:40:04 +0000</pubDate>
      <link>https://dev.to/mctechie/how-python-sees-variables-869</link>
      <guid>https://dev.to/mctechie/how-python-sees-variables-869</guid>
      <description>&lt;p&gt;In programming languages like &lt;em&gt;C&lt;/em&gt; and &lt;em&gt;Java&lt;/em&gt;, the concept of a variable is related to a &lt;em&gt;memory location&lt;/em&gt;. Hence, often a variable is defined as a &lt;strong&gt;named memory location&lt;/strong&gt;. Let us visualize this with an example, say we have the equation&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;int a = 1;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This may be viewed as a memory box:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fue8x58ebdm8el36v5v6i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fue8x58ebdm8el36v5v6i.png" alt="Variable a"&gt;&lt;/a&gt;&lt;br&gt;
Say we now store another value using the same variable&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a = 2;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This may be viewed as an updated memory box:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwixh5t6x3rlawz1esl90.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwixh5t6x3rlawz1esl90.png" alt="Updated Variable a"&gt;&lt;/a&gt;&lt;br&gt;
Let us now store the value of this variable into another&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;int b = a;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates another memory box as follows:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2zorouoj3qgivamcl330.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2zorouoj3qgivamcl330.png" alt="New Variable"&gt;&lt;/a&gt;&lt;br&gt;
This is basically how other programming languages visualize variables. We can simply say that the "&lt;strong&gt;memory location&lt;/strong&gt;" is emphasized which contains a "&lt;strong&gt;value&lt;/strong&gt;". However, Python views variables as "&lt;strong&gt;tags&lt;/strong&gt;" which are referenced (or tied) to some "&lt;strong&gt;value&lt;/strong&gt;" (or object).&lt;/p&gt;

&lt;p&gt;Let us visualize the above examples once again, say we have the equation&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a = 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This may be viewed as the value or object having priority, to which a tag is assigned:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fn69mfbjf2z57zq4wd1nh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fn69mfbjf2z57zq4wd1nh.png" alt="Variable a"&gt;&lt;/a&gt;&lt;br&gt;
Say we now store another value using the same variable&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a = 2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this case, the tag is simply changed to the new value, and the previous value (now unreferenced) is removed by the &lt;a href="https://dev.to/mcscodes/python-memory-management-hcb"&gt;&lt;strong&gt;garbage collector&lt;/strong&gt;&lt;/a&gt;:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffat8i51nfnm3sko5mt4y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffat8i51nfnm3sko5mt4y.png" alt="Updated Variable a"&gt;&lt;/a&gt;&lt;br&gt;
Let us now store the value of this variable into another&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;b = a
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this case, another tag is created that references to the &lt;strong&gt;same object:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffcrn4q3w0sa5yyp28fsz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffcrn4q3w0sa5yyp28fsz.png" alt="New Variable"&gt;&lt;/a&gt;&lt;br&gt;
Hence, only one memory is referenced by two names.&lt;/p&gt;

&lt;p&gt;So to conclude, other languages have variables, while Python has 'tags' to represent the values (or objects). This method allows Python to utilize memory efficiently, and this visualization helps in understanding variables in Python.&lt;/p&gt;

</description>
      <category>python</category>
      <category>codenewbie</category>
      <category>java</category>
      <category>programming</category>
    </item>
    <item>
      <title>Comments and Docstrings in Python</title>
      <dc:creator>Mcvean Soans</dc:creator>
      <pubDate>Wed, 25 Nov 2020 16:05:06 +0000</pubDate>
      <link>https://dev.to/mctechie/comments-and-docstrings-in-python-gaf</link>
      <guid>https://dev.to/mctechie/comments-and-docstrings-in-python-gaf</guid>
      <description>&lt;h3&gt;
  
  
  Comments in Python
&lt;/h3&gt;

&lt;p&gt;As we have seen in a previous post &lt;strong&gt;&lt;a href="https://dev.to/mcscodes/executing-a-python-program-208l"&gt;Executing a Python Program&lt;/a&gt;&lt;/strong&gt;, a comment is a line (or multiple lines) of code which do not execute when the program is run. The sole purpose of comments is to provide more information about the written code.&lt;/p&gt;

&lt;p&gt;Many a times while writing programs, we tend to ignore documenting the steps. This causes an issue not only to others that might read our code in the future, but our future selves too. For example, let us take a look at the following snippets which contain the exact same code -&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Snippet 1:&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;lst = [1,2,3,4,5]
for i in lst:
    print(i)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Snippet 2:&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;lst = [1,2,3,4,5] # Creating a list
# Looping over each element in the list
for i in lst:
    print(i) # Printing each element
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As we can see from the above snippets, the difference in the quality of code varies significantly. Any person can understand the functionality of the code from the second snippet easily as compared to the first snippet. Hence, we can conclude that proper documentation of the code using &lt;strong&gt;comments&lt;/strong&gt; is essential while developing any application.&lt;/p&gt;

&lt;p&gt;Python has 2 types of comments:&lt;/p&gt;

&lt;h4&gt;
  
  
  Single line comments -
&lt;/h4&gt;

&lt;p&gt;These comments begin with the &lt;strong&gt;&lt;em&gt;hash&lt;/em&gt;&lt;/strong&gt; (&lt;strong&gt;#&lt;/strong&gt;) symbol and the entire line after the hash symbol is treated as a comment.&lt;/p&gt;

&lt;h4&gt;
  
  
  Multi line comments -
&lt;/h4&gt;

&lt;p&gt;When we want to comment multiple lines of code, we can do it as follows&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Method 1:&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# This is the first comment
# This is the second comment
# This is the third comment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Method 2:&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"""
This is the first comment
This is the second comment
This is the third comment
"""
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Method 3:&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;'''
This is the first comment
This is the second comment
This is the third comment
'''
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Docstrings
&lt;/h3&gt;

&lt;p&gt;As we have previously seen, multi-line comments are regular strings which have the ability to span multiple lines. If these strings are not assigned to a variable, then they are removed from the memory by the &lt;strong&gt;&lt;a href="https://dev.to/mcscodes/python-memory-management-hcb"&gt;garbage collector&lt;/a&gt;&lt;/strong&gt;. Hence, using """ (triple double quotes) and ''' (triple single quotes) are not recommended for comments by developers since they occupy memory and delays the complete execution of the program.&lt;/p&gt;

&lt;p&gt;The strings enclose within """ or ''' are called &lt;strong&gt;&lt;em&gt;documentation strings&lt;/em&gt;&lt;/strong&gt; or &lt;strong&gt;&lt;em&gt;docstrings&lt;/em&gt;&lt;/strong&gt;. These are useful to create an API (Application Programming Interface) documentation file, that provides a description of various features of a software, language or a product.&lt;/p&gt;

&lt;p&gt;API documentation is critical if developers intend to distribute their work. Bad or improper documentation may lead to other developers not understanding the complexity in code, and they may completely reject the code simply because it did not make sense!&lt;/p&gt;

</description>
      <category>python</category>
      <category>codenewbie</category>
      <category>comments</category>
      <category>programming</category>
    </item>
    <item>
      <title>Python: Memory Management</title>
      <dc:creator>Mcvean Soans</dc:creator>
      <pubDate>Wed, 25 Nov 2020 06:38:23 +0000</pubDate>
      <link>https://dev.to/mctechie/python-memory-management-hcb</link>
      <guid>https://dev.to/mctechie/python-memory-management-hcb</guid>
      <description>&lt;h3&gt;
  
  
  Memory Management in Python
&lt;/h3&gt;

&lt;p&gt;In languages such as &lt;em&gt;C&lt;/em&gt; or &lt;em&gt;C++&lt;/em&gt;, programmers find it hectic to allocate and deallocate (free) memory while executing the programs. Python takes care of memory allocation and deallocation during runtime automatically.&lt;/p&gt;

&lt;p&gt;Everything is considered as an object in Python, be it strings, lists, and even Functions / modules are objects. For every object, memory has to be allocated. This task is done by the Memory Manager located inside the PVM.&lt;/p&gt;

&lt;p&gt;All of the objects created are stored in a separate memory called &lt;strong&gt;&lt;em&gt;heap&lt;/em&gt;&lt;/strong&gt;. It is the memory which is allocated during runtime. The size of the heap memory is variable for different systems and depends on the Random Access Memory (RAM) of the system. It can even increase or decrease as per the requirement of the programs.&lt;/p&gt;

&lt;p&gt;For our systems, the Operating System (OS) allocates memory for any program that runs on it. Python's &lt;strong&gt;&lt;em&gt;Raw Memory Allocator&lt;/em&gt;&lt;/strong&gt; runs on top of the OS which oversees the memory allocated for all of the objects. We also have &lt;strong&gt;&lt;em&gt;Object-specific memory allocators&lt;/em&gt;&lt;/strong&gt; which operate on the same heap. These memory allocators utilize various memory management policies (depending on the type of the objects) to allocate memory for the different objects.&lt;/p&gt;

&lt;p&gt;Sequentially, we can view memory management in Python as follows:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aeGf-j8y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/6as833lbk0jt88nqliou.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aeGf-j8y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/6as833lbk0jt88nqliou.png" alt="Memory Management in Python"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Garbage Collection in Python
&lt;/h3&gt;

&lt;p&gt;Garbage collector (&lt;em&gt;gc&lt;/em&gt;) is a Python module which deletes objects from the memory, which are not used in the program. The simplest way in which it handles deallocation (freeing memory), is by keeping a &lt;strong&gt;reference count&lt;/strong&gt; of the objects in the program. Whenever, an object is utilized in the program, it will be referenced atleast once i.e., it will have a reference count of atleast &lt;em&gt;1&lt;/em&gt;. When an object is found with reference count of &lt;em&gt;0&lt;/em&gt;, it figures out that the object is not being used in the program and deletes it from the memory.&lt;/p&gt;

&lt;p&gt;However, this approach does have a catch. Suppose we have a &lt;strong&gt;reference cycle&lt;/strong&gt; of 3 objects, which themselves reference to one another as follows:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--R7Lqoul5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/4c9n0ictmfvao08tb7rs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--R7Lqoul5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/4c9n0ictmfvao08tb7rs.png" alt="Object Reference Cycle"&gt;&lt;/a&gt;&lt;br&gt;
Even if the objects A, B and C are not used in the program, they have a reference count of &lt;em&gt;1&lt;/em&gt;. To overcome this situation, &lt;em&gt;gc&lt;/em&gt; uses an algorithm to remove objects from this cycle.&lt;/p&gt;

&lt;p&gt;The algorithm classifies the objects into &lt;strong&gt;three generations&lt;/strong&gt;. The newly created objects are generation &lt;em&gt;0&lt;/em&gt; objects. Now, first time when garbage collector sweeps through the memory and does not remove the objects from the memory, the objects are promoted to generation &lt;em&gt;1&lt;/em&gt;. The next sweep ensures that the unused objects are deleted from memory. If the object survives again, it is promoted to generation &lt;em&gt;2&lt;/em&gt;. Hence, Garbage collector tends to delete younger objects (generations &lt;em&gt;0&lt;/em&gt; and &lt;em&gt;1&lt;/em&gt;) rather than older objects (generation &lt;em&gt;2&lt;/em&gt;).&lt;/p&gt;

&lt;p&gt;Garbage collector runs &lt;em&gt;automatically&lt;/em&gt;, and Python schedules garbage collector depending on a metric (number) called &lt;strong&gt;&lt;em&gt;threshold&lt;/em&gt;&lt;/strong&gt;. This number represents the frequency of how many times garbage collector removed the objects from the memory. We can know the threshold number by using the &lt;strong&gt;&lt;em&gt;get_threshold()&lt;/em&gt;&lt;/strong&gt; method of the &lt;em&gt;gc&lt;/em&gt; module. When the equation &lt;code&gt;(numberOfAllocations - numberOfDeallocations) &amp;gt; threshold&lt;/code&gt; is satisfied, garbage collector runs automatically. However, if more and more objects are created and if the system runs out of memory, garbage collector does not run automatically to deallocate the memory, instead, an exception (runtime error) is thrown.&lt;/p&gt;

&lt;p&gt;When the programmer is sure that the program does not contain reference cycles, then automatic garbage collector is the most suitable choice. Whereas, the presence of reference cycles in the program requires the &lt;em&gt;gc&lt;/em&gt; module to be called manually. The &lt;strong&gt;&lt;em&gt;collect()&lt;/em&gt;&lt;/strong&gt; method is useful in this case.&lt;/p&gt;

&lt;p&gt;Manual garbage collection is done using 2 ways:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Time-based&lt;/strong&gt; - Garbage collector is called in certain intervals of time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Event-based&lt;/strong&gt; - Garbage collector is called on the basis of an event (eg: When the network connectivity of the application is lost, etc.)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A thing to keep in mind is that running the garbage collector too frequently will &lt;strong&gt;slow down&lt;/strong&gt; the program execution.&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>memory</category>
    </item>
    <item>
      <title>The bare-bones of a Python program</title>
      <dc:creator>Mcvean Soans</dc:creator>
      <pubDate>Wed, 25 Nov 2020 06:31:04 +0000</pubDate>
      <link>https://dev.to/mctechie/executing-a-python-program-208l</link>
      <guid>https://dev.to/mctechie/executing-a-python-program-208l</guid>
      <description>&lt;p&gt;Let's create our first Python program. Create a file and name it &lt;code&gt;hello.py&lt;/code&gt; and in any editor let's write a line of code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print('Hello World') # Our first line of code
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above program when run, prints out "Hello World!" onto the screen, and the stuff after the &lt;code&gt;#&lt;/code&gt; is considered as a comment. Comments and the various types will be covered in a later post, but for now let's assume that it is a line which will have no effect upon execution of the program.&lt;/p&gt;

&lt;p&gt;Every program written in Python &lt;strong&gt;should have&lt;/strong&gt; an extension &lt;code&gt;.py&lt;/code&gt; in order to be called a Python program.&lt;/p&gt;

&lt;p&gt;The next step after writing the code, is compiling the program into the &lt;strong&gt;byte code&lt;/strong&gt;. This is done by the &lt;strong&gt;Python compiler&lt;/strong&gt;. The byte code instructions are contained in a file &lt;code&gt;hello.pyc&lt;/code&gt;, where the &lt;code&gt;.pyc&lt;/code&gt; extension suggests a python compiled file.&lt;/p&gt;

&lt;p&gt;Any computer can execute only binary code (consisting of 1s and 0s), and hence it is essential to convert the byte code into &lt;strong&gt;machine code&lt;/strong&gt; (binary code) so that the computer is able to execute it. This conversion is done by the &lt;strong&gt;PVM&lt;/strong&gt; (Python Virtual Machine). PVM uses an &lt;strong&gt;interpreter&lt;/strong&gt; which understands the byte code and converts it into machine code understandable to the operating system.&lt;/p&gt;

&lt;p&gt;An interpreter translates the program source code line-by-line and hence is slower to execute the program. The &lt;strong&gt;PyPy&lt;/strong&gt; flavor of Python utilizes a JIT (Just In Time) compiler in the PVM instead of an interpreter so as to run the programs faster.&lt;/p&gt;

&lt;p&gt;Normally, while executing a Python program, the &lt;code&gt;.pyc&lt;/code&gt; files produced are not visible and the necessary steps / working is done internally by the Python compiler and the PVM in order to display the output on the screen.&lt;/p&gt;

&lt;p&gt;In order to execute the file, we use the &lt;code&gt;python&lt;/code&gt; command to call the Python compiler as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt;&amp;gt; python hello.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;While taking a closer look at the directory, we can see that no file with a &lt;code&gt;.pyc&lt;/code&gt; extension exists. All of the steps have been completed internally and only the final output is displayed.&lt;/p&gt;

&lt;p&gt;To separately create a &lt;code&gt;.pyc&lt;/code&gt; file from the source code, we can use the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt;&amp;gt; python -m py_compile hello.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;-m&lt;/code&gt; option represents &lt;em&gt;module&lt;/em&gt; and the &lt;code&gt;py_compile&lt;/code&gt; module generates the &lt;code&gt;.pyc&lt;/code&gt; file for the specified &lt;code&gt;.py&lt;/code&gt; file. The compiler creates a separate directory &lt;strong&gt;__pycache__&lt;/strong&gt; where the &lt;code&gt;.pyc&lt;/code&gt; file is stored. This file contains the machine code instructions and can be run on any platform using the PVM.&lt;/p&gt;

&lt;h3&gt;
  
  
  Some Flavors of Python (Python compilers)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CPython&lt;/strong&gt; - The standard Python compiler implemented in the &lt;em&gt;C&lt;/em&gt; language.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Jython&lt;/strong&gt; - Implementation of Python designed to run on &lt;em&gt;Java&lt;/em&gt; platform (executed by JVM).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IronPython&lt;/strong&gt; - Implementation of Python for .NET framework, written in &lt;em&gt;C# (C Sharp)&lt;/em&gt; language.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PyPy&lt;/strong&gt; - Implementation of Python using Python, written in &lt;em&gt;RPython&lt;/em&gt; (created in Python language).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RubyPython&lt;/strong&gt; - Designed for applications that utilize the &lt;em&gt;Ruby&lt;/em&gt; language.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Frozen Binaries (Executables)
&lt;/h3&gt;

&lt;p&gt;When a developer creates a software in Python, the 2 possible ways to produce the software to the end user include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Providing the &lt;code&gt;.pyc&lt;/code&gt; files&lt;/li&gt;
&lt;li&gt;Providing frozen binaries (&lt;code&gt;.exe&lt;/code&gt; files)
The first method expects the user to install PVM and run the &lt;code&gt;.pyc&lt;/code&gt; files. While, the second method provides the &lt;code&gt;.pyc&lt;/code&gt; files along with the PVM and the necessary Python libraries. These separate files are converted into a single executable file (generally with a &lt;code&gt;.exe&lt;/code&gt; extension), so that the user can directly execute the file by double clicking it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;Frozen binaries&lt;/em&gt; have a slightly larger size as compared to the  &lt;code&gt;.pyc&lt;/code&gt; files, since they contain the PVM as well as the library files. For creating these frozen binaries, we require third-party softwares. For example, &lt;em&gt;py2exe&lt;/em&gt; is a software the produces frozen binaries for the Windows operating system, and &lt;em&gt;pyinstaller&lt;/em&gt; is a similar tool for UNIX or LINUX.&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>computerscience</category>
      <category>compiler</category>
    </item>
    <item>
      <title>Python: Preamble</title>
      <dc:creator>Mcvean Soans</dc:creator>
      <pubDate>Wed, 25 Nov 2020 06:29:12 +0000</pubDate>
      <link>https://dev.to/mctechie/python-preamble-127m</link>
      <guid>https://dev.to/mctechie/python-preamble-127m</guid>
      <description>&lt;p&gt;This is the first post in the &lt;a href="https://dev.to/mcscodes/series/9852"&gt;&lt;strong&gt;Becoming a Python Developer&lt;/strong&gt;&lt;/a&gt; series! This series is intended towards everyone. Be it complete beginners or professional developers, the posts are sure to be helpful in grasping the concepts and a perfect launchpad for your Python journey! 😄&lt;/p&gt;

&lt;h1&gt;
  
  
  What is Python? Why is it gaining popularity?
&lt;/h1&gt;

&lt;p&gt;In recent times, the need for a developer is a programming language that provides both &lt;strong&gt;C-style&lt;/strong&gt; functional programming as well as &lt;strong&gt;Java-style&lt;/strong&gt; object orientation. Whenever, functional aspects like calculations or processing is involved, C-style coding is preferred, while the need for classes and objects is completed by Java-style coding.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Python&lt;/strong&gt; is an open-sourced programming language that combines the features of &lt;em&gt;C&lt;/em&gt; and &lt;em&gt;Java&lt;/em&gt;. It has exceptional procedural as well as object-oriented capabilities. Having said this, always remember that everything in Python is an &lt;strong&gt;object&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Some Features of Python
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Simple and Easy to learn&lt;/strong&gt; - Learning Python is very simple compared to other programming languages.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dynamically Typed&lt;/strong&gt; - In Python, we need not specifically declare the datatype of the variables used (unlike statically typed languages like C and Java).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Platform Independent&lt;/strong&gt; - When a Python program is compiled using a Python compiler, it generates byte code. Using a Python Virtual Machine (PVM), anyone can run the byte code instructions on any computer system.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Procedure and Object Oriented&lt;/strong&gt; - Python gives emphasis on the functions as well as objects.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scripting Language&lt;/strong&gt; - A scripting language is a programming language that utilizes an Interpreter to translate the source code into machine code on the fly (while running). Other scripting languages include PHP, Bash, etc.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database Connectivity&lt;/strong&gt; - Python provides Application Programming Interfaces (APIs) to connect its programs to all major databases like Oracle, MySql, SQLite Browser, etc.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Batteries Included&lt;/strong&gt; - Python contains several packages available for immediate use by developers. These packages make development easier due to the various features supported by them. Some of these packages include: &lt;strong&gt;numpy&lt;/strong&gt; - for working with single and multi-dimensional arrays, &lt;strong&gt;pandas&lt;/strong&gt; - for data analysis and data manipulation, &lt;strong&gt;matplotlib&lt;/strong&gt; - for data visualization, etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Some differences between &lt;strong&gt;C&lt;/strong&gt; and &lt;strong&gt;Python&lt;/strong&gt;
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
  &lt;tr&gt;
    &lt;th&gt;C&lt;/th&gt;
    &lt;th&gt;Python&lt;/th&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;It is a procedure-oriented programming language, and does not contain features such as objects, classes, etc.&lt;/td&gt;
    &lt;td&gt;It contains features from procedure-oriented programming languages as well as object oriented programming languages.&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Program execution is faster.&lt;/td&gt;
    &lt;td&gt;Slower execution of programs as compared to C. The PyPy flavor of Python programs run a bit faster.&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;It is a statically-typed language (variable declaration with appropriate datatype is compulsory).&lt;/td&gt;
    &lt;td&gt;It is a dynamically-typed language. Type declaration is not required.&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Memory allocation and deallocation requires user-intervention.&lt;/td&gt;
    &lt;td&gt;Memory allocation and deallocation is done automatically by the PVM.&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Indentation does not have any importance in C.&lt;/td&gt;
    &lt;td&gt;Indentation plays a major role and the code blocks need to be correctly indented.&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Some differences between &lt;strong&gt;Java&lt;/strong&gt; and &lt;strong&gt;Python&lt;/strong&gt;
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
  &lt;tr&gt;
    &lt;th&gt;Java&lt;/th&gt;
    &lt;th&gt;Python&lt;/th&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Java is essentially an object-oriented programming language.&lt;/td&gt;
    &lt;td&gt;Python blends functional programming features with the object-oriented approach of programming.&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Java programs are verbose (contain many lines of code).&lt;/td&gt;
    &lt;td&gt;Python programs are concise and compact, and very few lines of code are required to achieve any specified task.&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;It is compulsory to declare the datatypes of the variables, arrays, etc. (statically-typed language)&lt;/td&gt;
    &lt;td&gt;Type declaration is not required in Python (dynamically-typed language).&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Memory allocation and deallocation is done by JVM (Java Virtual Machine).&lt;/td&gt;
    &lt;td&gt;Memory allocation and deallocation is done by PVM (Python Virtual Machine).&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Indentation does not have any importance in Java. It is required only for better readability of the code.&lt;/td&gt;
    &lt;td&gt;Indentation plays a major role in Python, and improper indentation may lead to errors in the program.&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>objects</category>
    </item>
  </channel>
</rss>
