<?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: All About Python</title>
    <description>The latest articles on DEV Community by All About Python (@allaboutpython).</description>
    <link>https://dev.to/allaboutpython</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%2F2173597%2F86298d47-aee0-49fc-853f-fd7126d1213e.png</url>
      <title>DEV Community: All About Python</title>
      <link>https://dev.to/allaboutpython</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/allaboutpython"/>
    <language>en</language>
    <item>
      <title>Getting Started with Python: Installing Python and Writing Your First Program (Day 2 of 100 Days of Python)</title>
      <dc:creator>All About Python</dc:creator>
      <pubDate>Mon, 13 Jan 2025 13:06:27 +0000</pubDate>
      <link>https://dev.to/allaboutpython/getting-started-with-python-installing-python-and-writing-your-first-program-day-2-of-100-days-of-4d49</link>
      <guid>https://dev.to/allaboutpython/getting-started-with-python-installing-python-and-writing-your-first-program-day-2-of-100-days-of-4d49</guid>
      <description>&lt;p&gt;In the last blog, we talked about how a programmer is someone who writes a series of steps (called a program) for a computer to follow. Today, we'll dive deeper into different types of software and create our first Python program.&lt;/p&gt;

&lt;h2&gt;
  
  
  Program vs Software
&lt;/h2&gt;

&lt;p&gt;Before learning about different types of software, let's first understand what software is. Simply put, software is a collection of programs, data, and instructions that work together. For example, a railway ticket booking system is software because it includes different programs that handle tickets and data for trains and passengers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Types of Software
&lt;/h2&gt;

&lt;h3&gt;
  
  
  System Software
&lt;/h3&gt;

&lt;p&gt;System software manages hardware and allows users to run applications. Examples include operating systems like Windows and MacOS, as well as utilities like calculators or terminals. Think of it as the software that makes your computer run.&lt;/p&gt;

&lt;h3&gt;
  
  
  Application Software
&lt;/h3&gt;

&lt;p&gt;Application software helps users complete specific tasks. Any software you directly use on your computer—like Chrome, Excel, WhatsApp, or Instagram—is application software. These can be grouped into different categories, like:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Productivity Software&lt;/strong&gt;: word, powerpoint, excel etc,&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Web Browsers&lt;/strong&gt;: Google Chrome, Microsoft Edge, Mozilla Firefox etc.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multimedia Software&lt;/strong&gt;: VLC Media Player, Adobe Premier Pro, Adobe Photoshop etc.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Communication Software&lt;/strong&gt;: Outlook, WhatsApp etc.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;and many more...&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Python
&lt;/h2&gt;

&lt;p&gt;Before we start coding in Python, we need to install it. Here's how you can do that (we’ll be using MacOS, but Windows users can follow similar steps with slight changes):&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1&lt;/strong&gt;: Go to  python.org and download Python by clicking the yellow button (the version might differ, but that’s okay).&lt;br&gt;
&lt;strong&gt;Step 2&lt;/strong&gt;: Once downloaded, run the installer and follow the steps.&lt;br&gt;
&lt;strong&gt;Step 3&lt;/strong&gt;: For Windows, during installation, make sure to check the "Add Python to PATH" option.&lt;br&gt;
&lt;strong&gt;Step 4&lt;/strong&gt;: After installing, open the terminal (or command prompt for Windows) and type:&lt;/p&gt;

&lt;p&gt;For MacOS/Linux:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python3 --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For Windows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In both the cases, the output (based on version) should look something like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Python 3.11.5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This confirm the successful download and installation of python, If you still have issues with download, you can checkout this video I made some time back (at the top of the blog), regarding the same.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Visual Studio Code
&lt;/h2&gt;

&lt;p&gt;We will also install another software, named visual studio code (short form vscode) to write the Python code. The installation process is very simple.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1&lt;/strong&gt;: Go to &lt;a href="https://code.visualstudio.com" rel="noopener noreferrer"&gt;https://code.visualstudio.com&lt;/a&gt; and click on the download button (based on your operating system).&lt;br&gt;
&lt;strong&gt;Step 2&lt;/strong&gt;: Wait for the download to complete, and go through the installation wizard (just keep clicking on next, no need to change the default configuration).&lt;br&gt;
&lt;strong&gt;Step 3&lt;/strong&gt;: To confirm installation, check for Visual Studio Code installed in your applications on your system.&lt;/p&gt;
&lt;h2&gt;
  
  
  Writing our first program
&lt;/h2&gt;

&lt;p&gt;Now, let’s write the famous "Hello, World" program. This simple program is a rite of passage for every new programmer.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open VSCode, click 'File' &amp;gt; 'Open Folder,' and choose an empty folder (or create a new one named "First Program").&lt;/li&gt;
&lt;li&gt;On the left panel, click the file+ icon to create a new file and name it main.py.&lt;/li&gt;
&lt;li&gt;In the file, type or copy the following code:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello World&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This program simply instructs the computer to display the text "Hello World" on the console. To run, first click on Ctrl + S (or Cmd + S for MacOS) and simply open the terminal from vscode through the terminal option in title bar. Once done, type the following command:&lt;/p&gt;

&lt;p&gt;For Windows:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;For MacOS:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python3 main.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The program should give an output like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hello World
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Congratulations! you just created your first python in Python. And with this, we can end this blog.&lt;/p&gt;

&lt;h2&gt;
  
  
  Homework Assignment: Customize your program
&lt;/h2&gt;

&lt;p&gt;A little homework assignment for you all, try to change this program to print "Hello" and your name (like "Hello John Doe"). &lt;/p&gt;

&lt;h2&gt;
  
  
  Looking Forward
&lt;/h2&gt;

&lt;p&gt;For the next blog, we will dive deep in some terminologies related to Python programming (and programming in general) and create much more interesting programs.&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Decoding Python Data Types: The Building Blocks of Programming (Day 4 of 100 Days of Python)</title>
      <dc:creator>All About Python</dc:creator>
      <pubDate>Mon, 13 Jan 2025 13:03:57 +0000</pubDate>
      <link>https://dev.to/allaboutpython/decoding-python-data-types-the-building-blocks-of-programming-day-4-of-100-days-of-python-3oc0</link>
      <guid>https://dev.to/allaboutpython/decoding-python-data-types-the-building-blocks-of-programming-day-4-of-100-days-of-python-3oc0</guid>
      <description>&lt;p&gt;The first thing that kids aare taught as part of a structured curriculum is alphabets and numbers. They form the building blocks on top of which we build our understanding of the world. Similarly, to understand Python or any other programming language, we need to have clear understanding of its basic building blocks, the data types.&lt;/p&gt;

&lt;p&gt;Data types refer to different ways in which python can store any data. Just like we can have names, home addresses, email IDs and many other such data pertaining to a person, we can have different types of data that we would need to work on in programming.&lt;/p&gt;

&lt;p&gt;This blog post is meant to give absolute beginners a basic understanding of data types in python. In reality, there is still a lot to cover for many complex data types. But as a beginner, we don't need to worry about it for now. Let's start with understanding the different data types in python.&lt;/p&gt;

&lt;h2&gt;
  
  
  Data Types in Python
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftj3un1gmcsmzcq68hs2j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftj3un1gmcsmzcq68hs2j.png" alt="Image description" width="800" height="376"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Data types in python are broadly classified into 5 types, depending on similarity.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Numbers&lt;/li&gt;
&lt;li&gt;Sequences&lt;/li&gt;
&lt;li&gt;Sets&lt;/li&gt;
&lt;li&gt;Mappings&lt;/li&gt;
&lt;li&gt;None&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's go through each of them one by one. We will be using &lt;strong&gt;&lt;a href="http://localhost:3000/blogs/python-basics-features-execution-modes-keywords-variables-and-comments-day-3-off-100-days-of-python#interactive-mode" rel="noopener noreferrer"&gt;interactive mode&lt;/a&gt;&lt;/strong&gt; of python in this blog.&lt;/p&gt;

&lt;h3&gt;
  
  
  Numbers
&lt;/h3&gt;

&lt;p&gt;As the name suggests, these are the data types that store numeric values, like integers, decimal numbers and complex numbers.&lt;/p&gt;

&lt;h4&gt;
  
  
  Integer
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;All integer numbers fall into this data types&lt;/li&gt;
&lt;li&gt;Only integers fall into this category. If the number contains any decimal or an imaginary part (found in complex numbers) then it does not fall into integer data type&lt;/li&gt;
&lt;li&gt;Mathematical operations like addition, subtraction, multiplication or division can be performed on this data type&lt;/li&gt;
&lt;li&gt;The built in class for this data type is &lt;code&gt;int&lt;/code&gt; (just remember the class associated with each integer for now).
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;integer1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;13212&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;integer2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2938293&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;integer3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;All the above variables are of integer data type. If you try to get their class using the &lt;code&gt;type&lt;/code&gt; built-in function, you will get &lt;code&gt;int&lt;/code&gt; class.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;integer1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="nc"&gt;int&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Floating point
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;All numeric values within python that has a decimal in it, falls into this data type&lt;/li&gt;
&lt;li&gt;This data type can be uniquely identified by a decimal sign, for example:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;thisisaninteger&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;thisisafloat&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;12.0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;If I check their data types using the &lt;code&gt;type()&lt;/code&gt; function, the first variable will have &lt;code&gt;integer&lt;/code&gt; data type and the second one will have &lt;code&gt;float&lt;/code&gt; data type&lt;/li&gt;
&lt;li&gt;The built-in class name for float is &lt;code&gt;float&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;float1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;13212.0&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;float2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;2938293.234245234&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;float3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;float1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="nc"&gt;float&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Complex
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;All non-real or complex numbers fall into the category of complex data type&lt;/li&gt;
&lt;li&gt;This data type can be uniquely identified by j representing imaginary part of a complex number, for example:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;complex1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;2j&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;complex2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;23j&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The built-in class name for complex data type is &lt;code&gt;complex&lt;/code&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;complex1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;2j&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;complex2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;2j&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;complex3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;12j&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;complex1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="nc"&gt;complex&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Boolean
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Boolean data type is a subset of integer data type.&lt;/li&gt;
&lt;li&gt;It has only two values, &lt;code&gt;True&lt;/code&gt; and &lt;code&gt;False&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;True represents non-zero, non-null, non-empty value while False represents zero, null or empty value.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Note: True and False in python should be represented with T and F capital&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;The built-in class name for boolean is &lt;code&gt;bool&lt;/code&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;boolean1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;boolean2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;boolean1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="nc"&gt;bool&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Sequences
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;A sequence in python can be understood as an &lt;strong&gt;ordered collection of items&lt;/strong&gt;, which can be indexed by an integer.&lt;/li&gt;
&lt;li&gt;There are three sequences in python:

&lt;ol&gt;
&lt;li&gt;string&lt;/li&gt;
&lt;li&gt;lists&lt;/li&gt;
&lt;li&gt;tuples&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  String
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Is a collection of single characters&lt;/li&gt;
&lt;li&gt;Characters can be alphabets, digits, special characters or whitespaces&lt;/li&gt;
&lt;li&gt;String variables in python are declared using single quotes (‘) or double quotes (“), like this
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;string1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="err"&gt;“&lt;/span&gt;&lt;span class="n"&gt;Hello&lt;/span&gt; &lt;span class="n"&gt;World&lt;/span&gt;&lt;span class="err"&gt;”&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;We cannot perform numeric operations on strings&lt;/li&gt;
&lt;li&gt;The built-in class name for string is &lt;code&gt;str&lt;/code&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;string1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="err"&gt;“&lt;/span&gt;&lt;span class="n"&gt;Hello&lt;/span&gt; &lt;span class="n"&gt;World&lt;/span&gt;&lt;span class="err"&gt;”&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;string2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="err"&gt;“&lt;/span&gt;&lt;span class="n"&gt;All&lt;/span&gt; &lt;span class="n"&gt;About&lt;/span&gt; &lt;span class="n"&gt;Python&lt;/span&gt; &lt;span class="o"&gt;@&lt;/span&gt; &lt;span class="mi"&gt;123&lt;/span&gt; &lt;span class="err"&gt;!”&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;string1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="nc"&gt;str&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  List
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Is a sequence of items&lt;/li&gt;
&lt;li&gt;Items can be of any data type.&lt;/li&gt;
&lt;li&gt;List is always enclosed within square brackets [] and each item is separated by commas.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;list1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="err"&gt;“&lt;/span&gt;&lt;span class="n"&gt;item1&lt;/span&gt;&lt;span class="err"&gt;”&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;“&lt;/span&gt;&lt;span class="n"&gt;item2&lt;/span&gt;&lt;span class="err"&gt;”&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;“&lt;/span&gt;&lt;span class="n"&gt;item3&lt;/span&gt;&lt;span class="err"&gt;”&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The built-in class name for list is &lt;code&gt;list&lt;/code&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;list1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="err"&gt;“&lt;/span&gt;&lt;span class="n"&gt;item1&lt;/span&gt;&lt;span class="err"&gt;”&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;“&lt;/span&gt;&lt;span class="n"&gt;item2&lt;/span&gt;&lt;span class="err"&gt;”&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;“&lt;/span&gt;&lt;span class="n"&gt;item3&lt;/span&gt;&lt;span class="err"&gt;”&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;list2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;“&lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt;&lt;span class="err"&gt;”&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;list1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="nc"&gt;list&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Tuple
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Is a sequence of items, which cannot be changed.&lt;/li&gt;
&lt;li&gt;Items can be of any data type.&lt;/li&gt;
&lt;li&gt;Tuple is always enclosed within round brackets () and each item is separated by commas.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;tuple1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="err"&gt;“&lt;/span&gt;&lt;span class="n"&gt;item1&lt;/span&gt;&lt;span class="err"&gt;”&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;“&lt;/span&gt;&lt;span class="n"&gt;item2&lt;/span&gt;&lt;span class="err"&gt;”&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;“&lt;/span&gt;&lt;span class="n"&gt;item3&lt;/span&gt;&lt;span class="err"&gt;”&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The built-in class name for tuple is &lt;code&gt;tuple&lt;/code&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;tuple1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="err"&gt;“&lt;/span&gt;&lt;span class="n"&gt;item1&lt;/span&gt;&lt;span class="err"&gt;”&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;“&lt;/span&gt;&lt;span class="n"&gt;item2&lt;/span&gt;&lt;span class="err"&gt;”&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;“&lt;/span&gt;&lt;span class="n"&gt;item3&lt;/span&gt;&lt;span class="err"&gt;”&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;tuple2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;“&lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt;&lt;span class="err"&gt;”&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tuple1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="nc"&gt;list&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Sets
&lt;/h3&gt;

&lt;p&gt;The reason sets are different from other sequence data types is because unlike sequences, &lt;strong&gt;sets don't have any duplicates&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Represents unordered sequence of items in python.&lt;/li&gt;
&lt;li&gt;Is enclosed with curly brackets {} and items are separated by comma.&lt;/li&gt;
&lt;li&gt;The built-in class name for sets is &lt;code&gt;set&lt;/code&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;set1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;set2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="err"&gt;“&lt;/span&gt;&lt;span class="n"&gt;All&lt;/span&gt;&lt;span class="err"&gt;”&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;“&lt;/span&gt;&lt;span class="n"&gt;About&lt;/span&gt;&lt;span class="err"&gt;”&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="err"&gt;“&lt;/span&gt;&lt;span class="n"&gt;Python&lt;/span&gt;&lt;span class="err"&gt;”&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;set1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="nc"&gt;set&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;ul&gt;
&lt;li&gt;Signifies absence of data in python.&lt;/li&gt;
&lt;li&gt;It has only one value which is None.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;nothing&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nothing&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The built-in class name for None is &lt;code&gt;NoneType&lt;/code&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="nc"&gt;NoneType&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Mappings
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;These are the unordered data type containing data in the form of key value pair&lt;/li&gt;
&lt;li&gt;It has only one data type within it, called dictionary.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Dictionary
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Holds data in key value pair.&lt;/li&gt;
&lt;li&gt;Items can be of any data type.&lt;/li&gt;
&lt;li&gt;List is always enclosed within round brackets () and each item is separated by commas.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;dict1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="err"&gt;“&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="err"&gt;”&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="err"&gt;“&lt;/span&gt;&lt;span class="n"&gt;All&lt;/span&gt; &lt;span class="n"&gt;About&lt;/span&gt; &lt;span class="n"&gt;Python&lt;/span&gt;&lt;span class="err"&gt;”&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The built-in class name for tuple is &lt;code&gt;tuple&lt;/code&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;dict1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="err"&gt;“&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="err"&gt;”&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="err"&gt;“&lt;/span&gt;&lt;span class="n"&gt;All&lt;/span&gt; &lt;span class="n"&gt;About&lt;/span&gt; &lt;span class="n"&gt;Python&lt;/span&gt;&lt;span class="err"&gt;”&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dict1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="nc"&gt;dict&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Homework Assignment: Storing Your Information
&lt;/h2&gt;

&lt;p&gt;A little homework assignment for you all, try creating a list, tuple and set which stores the following values:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your full name&lt;/li&gt;
&lt;li&gt;Your age&lt;/li&gt;
&lt;li&gt;Your email ID
And also try to create a dictionary with the same.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this blog, we covered the basic data types in Python: numbers, sequences, sets, mappings, and None. Each type is used to store different kinds of data, and understanding these types is the first step in becoming a Python programmer.&lt;/p&gt;

&lt;p&gt;In the next blog, we will dive deeper into functions in Python and why they are important.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Mastering Python Functions: Unlocking the Power of Reusable Code (Day 5 of 100 Days of Python)</title>
      <dc:creator>All About Python</dc:creator>
      <pubDate>Mon, 13 Jan 2025 13:01:09 +0000</pubDate>
      <link>https://dev.to/allaboutpython/mastering-python-functions-unlocking-the-power-of-reusable-code-day-4-of-100-days-of-python-1ogm</link>
      <guid>https://dev.to/allaboutpython/mastering-python-functions-unlocking-the-power-of-reusable-code-day-4-of-100-days-of-python-1ogm</guid>
      <description>&lt;p&gt;When we were kids, we were taught to add single digit numbers. After some practice and time, we were able to do it with ease. But as number of digits increased, we started using pen and paper to add one digit at a time and also note down the carry number. The reason was simple, unless we train our brains, we have a limit till which we can process information. In simple terms, adding numbers with multiple digits was a &lt;strong&gt;complex task&lt;/strong&gt; for our brains.&lt;/p&gt;

&lt;p&gt;Yet, we were able to solve the questions by &lt;strong&gt;breaking down the problem into smaller steps&lt;/strong&gt;. In case of addition, it was to add one digit at a time, add the carry to the next number, and continue it for each number. What this example teaches us is that &lt;strong&gt;complex problems can be broken down into sub-problems&lt;/strong&gt; to make it easy to solve. &lt;/p&gt;

&lt;p&gt;We face a similar challenge in programming, when we write program in python (or in any other language). Experience shows that most programmers cannot keep track of more than 10 statements or so at a time. So we cannot just "attack the problem" as a whole, but instead divide it into sub problems and solve it. Functions in python allows us to do the same.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Modular approach (aka stepwise refinement method)&lt;/strong&gt; in programming talks about breaking a problem into subproblems (in the form of functions which we will discuss later) and then further breaking down the subproblems until we reach a level where we can easily solve it. At the end, we merge all the subproblems and get our final solution. Algorithmic techniques like "divide and conquer", "dynamic programming" are all based on the approach to divide an unsolvable large problem into multiple solvable subproblems.&lt;/p&gt;

&lt;p&gt;In this blog, we will talk about how we can use functions in python to adapt a modular approach to programming. &lt;/p&gt;

&lt;h1&gt;
  
  
  Functions in Python
&lt;/h1&gt;

&lt;p&gt;Functions are reusable blocks of code in a programming language that have a specific task/purpose. They can take input(s), process data and return output(s) (although it is not necessary that they take input everytime or return output everytime). To strengthen our understanding of functions, first let's use the functions that comes built in python to see how they word.&lt;/p&gt;

&lt;h2&gt;
  
  
  Built-in Functions
&lt;/h2&gt;

&lt;p&gt;As the name suggests, these functions come built-in in python and can be used anywhere in a python code. We will run python in &lt;strong&gt;&lt;a href="http://allaboutpython.vercel.app/blogs/python-basics-features-execution-modes-keywords-variables-and-comments-day-3-off-100-days-of-python#interactive-mode" rel="noopener noreferrer"&gt;interactive mode&lt;/a&gt;&lt;/strong&gt; to run all our code all the code in this blog. Let's go through some functions one by one.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;input&lt;/code&gt; function
&lt;/h3&gt;

&lt;p&gt;First in our list is the &lt;code&gt;input&lt;/code&gt; function. This function is responsible for taking any data as input from the user. The function takes the input and returns it as a string. Here's how you can use it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Enter a name: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;Enter&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;All&lt;/span&gt; &lt;span class="n"&gt;About&lt;/span&gt; &lt;span class="n"&gt;Python&lt;/span&gt;

&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;
&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;All About Python&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The function takes in an input string (which is displayed to the user when taking input) and returns the data that the user entered.&lt;/p&gt;

&lt;p&gt;In this example, the user is prompted to enter its name, and the &lt;code&gt;input&lt;/code&gt; function stores it in the &lt;code&gt;name&lt;/code&gt; variable. Later, the data from that variable can be displayed to the users.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;eval&lt;/code&gt; function
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;eval&lt;/code&gt; function is used to evaluate a string, which could be any &lt;strong&gt;valid&lt;/strong&gt; python statement.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;eval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;10+12&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="mi"&gt;22&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;eval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;print(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello World&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;)&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;Hello&lt;/span&gt; &lt;span class="n"&gt;World&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;code&gt;print&lt;/code&gt; function
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;print&lt;/code&gt; function is used to display a value to the console. You can directly pass a string or a number you want to be displayed, or you can pass a variable and &lt;code&gt;print&lt;/code&gt; will display the content stored in the variable.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;One thing to note here is that when we type the name of the variable in &lt;strong&gt;interactive mode&lt;/strong&gt;, it displays the content within the variable, like so.&lt;/p&gt;


&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello World&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;string&lt;/span&gt;
&lt;span class="n"&gt;Hello&lt;/span&gt; &lt;span class="n"&gt;World&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;However, this won't work on &lt;strong&gt;shell mode&lt;/strong&gt;. To display the value in the console, we need to use the &lt;code&gt;print&lt;/code&gt; function.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you want to print multiple values, separated by spaces, you can pass those values (comma separated) within the print function, like so.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;series:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;series&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The values passed within &lt;code&gt;print&lt;/code&gt; function are displayed on a single line. To display values on multiple lines, we can use &lt;code&gt;\n&lt;/code&gt; character for new line, like so.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;first line&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;second line&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;third line&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;first&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt;
&lt;span class="n"&gt;second&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt;
&lt;span class="n"&gt;third&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;\n&lt;/code&gt; is one of the special characters called &lt;strong&gt;escape sequences&lt;/strong&gt;. Few other escape sequences are &lt;code&gt;\t&lt;/code&gt;, &lt;code&gt;\b&lt;/code&gt;, &lt;code&gt;\f&lt;/code&gt; and &lt;code&gt;\r&lt;/code&gt;. As an excercise, try using them with print statement and see how it looks.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;round&lt;/code&gt; function
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;round&lt;/code&gt; function is used to round off floating point numbers to a specific number of places. For ex:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;89.625&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="mf"&gt;89.62&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;34.12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="mf"&gt;34.1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;code&gt;min&lt;/code&gt; and &lt;code&gt;max&lt;/code&gt; function
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;min&lt;/code&gt; and &lt;code&gt;max&lt;/code&gt; functions are used to check to compare two or more numbers and return the minimum and maximum numbers among them respectively.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;59&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;95.6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;95.2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="mf"&gt;95.6&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;59&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;95.6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;95.2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;The function requires at least two inputs to work (coz you can't just compare one number with another)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can also compare string values with them. In case of strings, it will simply compare strings based on the ASCII value of their characters (like a &amp;lt; b and c &amp;lt; d).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;alpha&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;beta&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;gaama&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;yo&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;yo&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;alpha&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;beta&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;gaama&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;yo&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;alpha&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;You &lt;strong&gt;cannot&lt;/strong&gt; compare strings with numbers using &lt;code&gt;min&lt;/code&gt; and &lt;code&gt;max&lt;/code&gt; function.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;pow&lt;/code&gt; function
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;pow&lt;/code&gt; function stands for power. It is used to find a number raised to the power of another number, like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="mi"&gt;8&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="mi"&gt;9&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;code&gt;dir&lt;/code&gt; function
&lt;/h3&gt;

&lt;p&gt;Apart from the above functions, there are some builtin function that help developer know more about other functions and data in python. There are 3 such functions we are going to discuss:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;dir&lt;/code&gt; function&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;type&lt;/code&gt; function&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;help&lt;/code&gt; function&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;code&gt;dir&lt;/code&gt; function is used to list all the &lt;strong&gt;attributes&lt;/strong&gt; and &lt;strong&gt;methods&lt;/strong&gt; present within an object.&lt;/p&gt;

&lt;p&gt;We haven't discussed attributes and methods yet, but you can understand them as crucial data related to that object.&lt;/p&gt;

&lt;p&gt;Here's how the dir function output looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;dir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__abs__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__add__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__and__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__bool__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__ceil__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__class__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__delattr__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__dir__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__divmod__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__doc__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__eq__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__float__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__floor__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__floordiv__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__format__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__ge__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__getattribute__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__getnewargs__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__getstate__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__gt__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__hash__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__index__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__init__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__init_subclass__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__int__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__invert__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__le__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__lshift__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__lt__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__mod__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__mul__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__ne__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__neg__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__new__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__or__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__pos__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__pow__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__radd__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__rand__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__rdivmod__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__reduce__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__reduce_ex__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__repr__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__rfloordiv__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__rlshift__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__rmod__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__rmul__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__ror__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__round__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__rpow__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__rrshift__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__rshift__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__rsub__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__rtruediv__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__rxor__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__setattr__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__sizeof__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__str__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__sub__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__subclasshook__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__truediv__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__trunc__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__xor__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;as_integer_ratio&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;bit_count&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;bit_length&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;conjugate&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;denominator&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;from_bytes&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;imag&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;numerator&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;real&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;to_bytes&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What the function represents here is a list of all the attributes and methods related to the &lt;code&gt;int&lt;/code&gt; class object (the number we passed onto it).&lt;/p&gt;

&lt;p&gt;We don't need to understand it yet, but this function can be &lt;strong&gt;really helpful in the future&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;type&lt;/code&gt; function
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;type&lt;/code&gt; function allows us to view the data type of the daya passed onto it. In interactive mode, this function returns a string of the format &lt;code&gt;&amp;lt;class 'type'&amp;gt;&lt;/code&gt;, where type is replaced with the type of the data, for example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="nc"&gt;int&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="gp"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;string&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="nc"&gt;str&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;code&gt;help&lt;/code&gt; function
&lt;/h3&gt;

&lt;p&gt;The help function helps display information about python modules, classes and functions. This functions is only useful in &lt;strong&gt;interactive mode&lt;/strong&gt;, where it opens a help utility which shows information about the object passed onto it.&lt;/p&gt;

&lt;p&gt;For example, passing the &lt;code&gt;max&lt;/code&gt; function on &lt;code&gt;help&lt;/code&gt; displays the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;help&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;max&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Help on built-in function max in module builtins:

max(...)
    max(iterable, *[, default=obj, key=func]) -&amp;gt; value
    max(arg1, arg2, *args, *[, key=func]) -&amp;gt; value

    With a single iterable argument, return its biggest item. The
    default keyword-only argument specifies an object to return if
    the provided iterable is empty.
    With two or more arguments, return the largest argument.
(END)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;There are still multiple functions we can talk about in this blog, but it would end up being too much for a single blog post. Thus, we conclude today's blog.&lt;/p&gt;

&lt;p&gt;For those of you who want to know all the builtin functions in python, you can try running the following command in interactive mode and get surprised.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;dir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;__builtins__&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the next blog post, I would talk about some more builtin functions using modules like &lt;code&gt;math&lt;/code&gt; and &lt;code&gt;random&lt;/code&gt; and talk about some properties of functions like &lt;code&gt;composition&lt;/code&gt;, &lt;code&gt;type conversion&lt;/code&gt;.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>What is Programming? A Beginner's Guide to the World of Coding (Day 1 of 100 Days of Python)</title>
      <dc:creator>All About Python</dc:creator>
      <pubDate>Wed, 08 Jan 2025 15:00:43 +0000</pubDate>
      <link>https://dev.to/allaboutpython/what-is-programming-a-beginners-guide-to-the-world-of-coding-day-1-of-100-days-of-python-2b9g</link>
      <guid>https://dev.to/allaboutpython/what-is-programming-a-beginners-guide-to-the-world-of-coding-day-1-of-100-days-of-python-2b9g</guid>
      <description>&lt;h2&gt;
  
  
  The Child and the Computer: Understanding Programming
&lt;/h2&gt;

&lt;p&gt;Have you ever watched a child learn? They start as a "blank canvas," needing guidance to master everyday activities like brushing their teeth or pouring a glass of water. Just as we effortlessly perform these tasks, a computer requires instruction to operate effectively.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Computer: A Modern Child
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjiofregljxsv7z65pk57.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjiofregljxsv7z65pk57.png" alt="A child drinking water" width="400" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Think of a computer as a child—both need components to function. A child has hands, legs, and a brain to learn and grow, while a computer consists of physical components that allow it to perform tasks. (We can explore these computer components in detail another time.)&lt;/p&gt;

&lt;p&gt;Just as a child relies on a parent to learn basic skills, a computer depends on a programmer to understand how to execute actions. This skilled individual guides the computer, teaching it how to perform tasks independently in the future.&lt;/p&gt;

&lt;p&gt;A child needs an adult (like a mother or father), who knows how to perform the day-to-day activities to be able to teach the child, so that one day they can perform it themselves. Similarly, a computer needs someone who is skilled enough, to tell the computer how to perform an action, in the hopes that the computer will perform it by itself afterwards. The skilled person teaching the computer here is pretty much what a programmer is.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a Programmer ?
&lt;/h2&gt;

&lt;p&gt;A programmer is someone who instructs a computer on how to accomplish specific tasks. Let’s return to our earlier analogy: if a mother teaches her child to drink water, she breaks down the process into manageable steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to the kitchen.&lt;/li&gt;
&lt;li&gt;Retrieve a glass.&lt;/li&gt;
&lt;li&gt;Go to the water source.&lt;/li&gt;
&lt;li&gt;Fill the glass.&lt;/li&gt;
&lt;li&gt;Drink the water.&lt;/li&gt;
&lt;li&gt;Return the glass to the sink.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Similarly, a programmer outlines a sequence of steps—known as a program—that a computer follows to achieve desired outcomes.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a Programming Language ?
&lt;/h2&gt;

&lt;p&gt;In our example, the mother communicates with her child using gestures or, later, spoken language. For a programmer, a programming language serves the same purpose: it’s a medium for conveying instructions to the computer.&lt;/p&gt;

&lt;p&gt;Programming languages feature syntax that resembles English, using words and symbols to communicate effectively. Just as a polyglot speaks multiple languages, a programmer might use several programming languages. One popular choice is &lt;strong&gt;Python&lt;/strong&gt; (the theme of this blog site), which offers a user-friendly way to instruct computers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Programmer vs Coder vs Developers
&lt;/h3&gt;

&lt;p&gt;The terms coder, programmer, and developer can often confuse newcomers, so let’s clarify:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Coder&lt;/strong&gt;: Think of a coder as someone who writes code—like a typewriter producing text. This is often considered a beginner’s level.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Programmer&lt;/strong&gt;: A step beyond, a programmer designs and writes programs, akin to a writer structuring an article.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Developer&lt;/strong&gt;: The most advanced of the three, a developer oversees the creation of complex programs, similar to an editor-in-chief managing a publication.&lt;/p&gt;

&lt;p&gt;The ultimate goal is to evolve into a skilled developer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why do we need programming ?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh19c13axslbxoeyrmvur.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh19c13axslbxoeyrmvur.png" alt="World of programming" width="640" height="640"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Computers are amazing when it comes to getting stuff done fast and without mistakes. Unlike us humans, who sometimes slip up, a good computer program can run almost perfectly. That’s why we use computers for just about everything these days (and yep, you're reading this on one right now!).&lt;/p&gt;

&lt;p&gt;If you stop to think about it, the internet as a whole depends on computers and code. Imagine a day without Instagram, Snapchat, or YouTube—sounds terrible, right? Every single website you visit works because of computer programs. Even the browser you're using, like Chrome, Edge, or Safari, is just another computer program. Oh, and the operating system on your phone or laptop? That’s code too!&lt;/p&gt;

&lt;p&gt;Computers aren’t just in our homes and pockets either. Hospitals, businesses, and even the military rely on them. Fun fact: some missiles even have tiny computers inside them, running special programs. Oh, and did you know the internet was actually invented for the military before it became what it is today?&lt;/p&gt;

&lt;p&gt;So, as long as we keep using computers for everything (which we definitely will), people who write code will always have a job. In short, computers and programming are here to stay!&lt;/p&gt;

&lt;h2&gt;
  
  
  Looking Ahead
&lt;/h2&gt;

&lt;p&gt;Since this is our first discussion, I’ll keep it brief for now. In our next blog, we’ll explore the fascinating programs that developers create and their impact on our digital world. Stay tuned !&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>python</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>What is Programming? A Beginner's Guide to the World of Coding (Day 1 of 100 Days of Python)</title>
      <dc:creator>All About Python</dc:creator>
      <pubDate>Sun, 06 Oct 2024 11:07:45 +0000</pubDate>
      <link>https://dev.to/allaboutpython/what-is-programming-a-beginners-guide-to-the-world-of-coding-day-1-of-100-days-of-python-1efh</link>
      <guid>https://dev.to/allaboutpython/what-is-programming-a-beginners-guide-to-the-world-of-coding-day-1-of-100-days-of-python-1efh</guid>
      <description>&lt;h2&gt;
  
  
  The Child and the Computer: Understanding Programming
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxj1sn2ijkle4hu1b0712.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxj1sn2ijkle4hu1b0712.png" alt="Entering the world of programming" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Have you ever watched a child learn? They start as a "blank canvas," needing guidance to master everyday activities like brushing their teeth or pouring a glass of water. Just as we effortlessly perform these tasks, a computer requires instruction to operate effectively.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Computer: A Modern Child
&lt;/h2&gt;

&lt;p&gt;Think of a computer as a child—both need components to function. A child has hands, legs, and a brain to learn and grow, while a computer consists of physical components that allow it to perform tasks. (We can explore these computer components in detail another time.)&lt;/p&gt;

&lt;p&gt;Just as a child relies on a parent to learn basic skills, a computer depends on a programmer to understand how to execute actions. This skilled individual guides the computer, teaching it how to perform tasks independently in the future.&lt;/p&gt;

&lt;p&gt;A child needs an adult (like a mother or father), who knows how to perform the day-to-day activities to be able to teach the child, so that one day they can perform it themselves. Similarly, a computer needs someone who is skilled enough, to tell the computer how to perform an action, in the hopes that the computer will perform it by itself afterwards. The skilled person teaching the computer here is pretty much what a programmer is.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a Programmer ?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy7r6lxy16j7w2s8i2tl8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy7r6lxy16j7w2s8i2tl8.png" alt="A child learning to drink water" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A programmer is someone who instructs a computer on how to accomplish specific tasks. Let’s return to our earlier analogy: if a mother teaches her child to drink water, she breaks down the process into manageable steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to the kitchen.&lt;/li&gt;
&lt;li&gt;Retrieve a glass.&lt;/li&gt;
&lt;li&gt;Go to the water source.&lt;/li&gt;
&lt;li&gt;Fill the glass.&lt;/li&gt;
&lt;li&gt;Drink the water.&lt;/li&gt;
&lt;li&gt;Return the glass to the sink.&lt;/li&gt;
&lt;li&gt;Similarly, a programmer outlines a sequence of steps—known as a program—that a computer follows to achieve desired outcomes.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What is a Programming Language
&lt;/h2&gt;

&lt;p&gt;In our example, the mother communicates with her child using gestures or, later, spoken language. For a programmer, a programming language serves the same purpose: it’s a medium for conveying instructions to the computer.&lt;/p&gt;

&lt;p&gt;Programming languages feature syntax that resembles English, using words and symbols to communicate effectively. Just as a polyglot speaks multiple languages, a programmer might use several programming languages. One popular choice is Python (the theme of this blog site), which offers a user-friendly way to instruct computers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Programmer vs Coder vs Developer
&lt;/h2&gt;

&lt;p&gt;The terms coder, programmer, and developer can often confuse newcomers, so let’s clarify:&lt;/p&gt;

&lt;p&gt;Coder: Think of a coder as someone who writes code—like a typewriter producing text. This is often considered a beginner’s level.&lt;/p&gt;

&lt;p&gt;Programmer: A step beyond, a programmer designs and writes programs, akin to a writer structuring an article.&lt;/p&gt;

&lt;p&gt;Developer: The most advanced of the three, a developer oversees the creation of complex programs, similar to an editor-in-chief managing a publication.&lt;/p&gt;

&lt;p&gt;The ultimate goal is to evolve into a skilled developer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why do we need programming ?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuby2z849102bmmt0gw98.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuby2z849102bmmt0gw98.png" alt="World full of people using computers" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Computers are amazing when it comes to getting stuff done fast and without mistakes. Unlike us humans, who sometimes slip up, a good computer program can run almost perfectly. That’s why we use computers for just about everything these days (and yep, you're reading this on one right now!).&lt;/p&gt;

&lt;p&gt;If you stop to think about it, the internet as a whole depends on computers and code. Imagine a day without Instagram, Snapchat, or YouTube—sounds terrible, right? Every single website you visit works because of computer programs. Even the browser you're using, like Chrome, Edge, or Safari, is just another computer program. Oh, and the operating system on your phone or laptop? That’s code too!&lt;/p&gt;

&lt;p&gt;Computers aren’t just in our homes and pockets either. Hospitals, businesses, and even the military rely on them. Fun fact: some missiles even have tiny computers inside them, running special programs. Oh, and did you know the internet was actually invented for the military before it became what it is today?&lt;/p&gt;

&lt;p&gt;So, as long as we keep using computers for everything (which we definitely will), people who write code will always have a job. In short, computers and programming are here to stay!&lt;/p&gt;

&lt;h2&gt;
  
  
  Looking Ahead.
&lt;/h2&gt;

&lt;p&gt;Since this is our first discussion, I’ll keep it brief for now. In our next blog, we’ll explore the fascinating programs that developers create and their impact on our digital world. Stay tuned!&lt;/p&gt;

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