<?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: EstherWanjiru</title>
    <description>The latest articles on DEV Community by EstherWanjiru (@estherwanjiru).</description>
    <link>https://dev.to/estherwanjiru</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%2F670227%2F44b308c0-e7ee-4164-95d1-c1a2f6c2cb58.png</url>
      <title>DEV Community: EstherWanjiru</title>
      <link>https://dev.to/estherwanjiru</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/estherwanjiru"/>
    <language>en</language>
    <item>
      <title>Git in just a few minutes</title>
      <dc:creator>EstherWanjiru</dc:creator>
      <pubDate>Mon, 13 Dec 2021 15:58:42 +0000</pubDate>
      <link>https://dev.to/estherwanjiru/git-in-just-a-few-minutes-3k69</link>
      <guid>https://dev.to/estherwanjiru/git-in-just-a-few-minutes-3k69</guid>
      <description>&lt;p&gt;Hey, here's a deep dive into Git. &lt;/p&gt;

&lt;p&gt;Incase you missed the Introduction to git and GitHub, &lt;a href="https://dev.to/estherwanjiru/introduction-to-git-and-github-25ei"&gt;start here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Whether you are a long time programmer or are just getting started, you know that Git is quite pivotal in your coding journey.&lt;/p&gt;

&lt;p&gt;Git is a distributed version control system that makes tracking changes to your code very easy. It's easy to swap across versions and well who doesn't like the idea that one can undo the changes in your code through Git.&lt;/p&gt;

&lt;p&gt;Lastly, Git is so ideal when incorporated in Teams.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://git-scm.com/book/en/v2/Getting-Started-Installing-Git%5B%5D"&gt;Guide to install Git:&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After installation, Configure it with your GitHub account.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: _(Option1)_Initialize Git in your existing project&lt;/strong&gt;&lt;br&gt;
To do this simply run the command in the terminal from the folder that contains all your project files. This will add a .git folder to your project that Git will use to track all the changes you make to your project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Git init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;_(Option2)_Cloning your repository(entire project being managed by Git) by creating a new repo or getting an existing repository  and copying the link to clone the project. Ensure you pick the right url according to how you set up your Git, either ssh or http. Thereafter type the command below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Git clone ssh_url or Git clone http
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;in your terminal with the copied url at the end of the command. This copies all the code from the repo on to your computer and sets up Git to track all the changes. It adds a .git folder so that when you are ready to push your changes to GitHub, git will already know where to push them too.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Git structure&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Working Directory&lt;/strong&gt; - All the files in the work repository in their current state. At this point none of the working repositories are being tracked by Git. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Index/ staging&lt;/strong&gt; - To track these changes in the work directory we need to add them to the Index. This can be done by using the command below.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This tells Git we want to track all the changes that have been made in the working directory. This still doesn't make the changes in the official version in your code that you can change in between them. Which is why we commit these changes from the index to the final stage, the Head. Using the command below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git commit -m "message saved with the commit."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3.&lt;strong&gt;Head&lt;/strong&gt; - This tells git that the changes are final and requires a message to be saved with the commit. After committing changes to the head, they are saved as a version on our computer but are not in our remote repository on GitHub. &lt;/p&gt;

&lt;p&gt;In order to get these changes to our remote repository on GitHub, we need to push them to GitHub using the command below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you set up your project using &lt;code&gt;git clone&lt;/code&gt;, then Git will already know where to push all the files to. But if you used &lt;code&gt;git init&lt;/code&gt; to initialize a new project, then it will need to be told where to push these changes to. This can be done by:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Creating a repository on GitHub&lt;/li&gt;
&lt;li&gt;Copy the ssh_url for cloning.&lt;/li&gt;
&lt;li&gt;Thereafter, you can use the origin command below. This tells Git that we have a remote repository called origin at the copied url.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git remote add origin ssh_url
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With the remote repo added, we can use the &lt;code&gt;git push&lt;/code&gt; command to push the changes to the remote repo on GitHub.&lt;/p&gt;

&lt;h2&gt;
  
  
  So far... we can  🥷🏻🦸🏻‍♀️
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Create a repository.&lt;/li&gt;
&lt;li&gt;Make changes to it.&lt;/li&gt;
&lt;li&gt;Save the changes.&lt;/li&gt;
&lt;li&gt;Push the changes to GitHub.&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  What if  🤔
&lt;/h1&gt;

&lt;p&gt;One of your team members wants to pull down the changes that we have pushed to GitHub on to their local computer, this is where we use the command below in their terminal and all the changes from GitHub will be pulled onto their local computer and merges with all the changes that they have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git pull
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  That's basically all you need to know about Git to get started!!!
&lt;/h1&gt;

&lt;p&gt;Please make sure you leave a like 👍/loveheart ❤️ on this one. It encourages one to write more and more 🎉 🎊&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>tutorial</category>
      <category>git</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Introduction to Git and GitHub</title>
      <dc:creator>EstherWanjiru</dc:creator>
      <pubDate>Mon, 06 Dec 2021 20:55:11 +0000</pubDate>
      <link>https://dev.to/estherwanjiru/introduction-to-git-and-github-25ei</link>
      <guid>https://dev.to/estherwanjiru/introduction-to-git-and-github-25ei</guid>
      <description>&lt;p&gt;I had an interesting Read on Git sometime back and i thought i could feature that here. &lt;br&gt;
Someone said that experiments are logged on in laboratory notebooks, inventory is jotted down for future reference, students write their notes on their books for future reference as well. That means we look at it this way too. Version control is a way of documenting your code for future references as well as go back to code you have written way before. &lt;/p&gt;

&lt;p&gt;I bet you got that. #Smartdev&lt;br&gt;
After reading this tutorial you’ll be able to answer the following questions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What is version control?&lt;/li&gt;
&lt;li&gt;What is git?&lt;/li&gt;
&lt;li&gt;How does git work?&lt;/li&gt;
&lt;li&gt;What is GitHub?&lt;/li&gt;
&lt;li&gt;What is the difference between git and GitHub?&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  So...🤔
&lt;/h1&gt;

&lt;h2&gt;
  
  
  What is Version Control?
&lt;/h2&gt;

&lt;p&gt;It is a way to document the code you use for analysis. &lt;br&gt;
It's a category of software tools that helps software developers to document and track their code over time.&lt;/p&gt;

&lt;h2&gt;
  
  
  What about Git!!
&lt;/h2&gt;

&lt;p&gt;Git is a distributed Version Control system created by Linus Torvalds in 2005 for the development of the Linux Kernel, that makes tracking code over time easy and effortless.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Git:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Tracks iterative change that's made to the code one tells it to manage. Therefore, you can experiment with new ideas but always have the option to revert to a specific past version of the code you used to generate particular results.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It facilitates collaboration. You can record messages as you save each successive version so that you (or anyone else) reviewing the development history of the code is able to understand the rationale for the given edits. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Easily switches between Versions of your code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Easily undo changes.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What is GitHub?🤔
&lt;/h2&gt;

&lt;p&gt;First, GitHub is the largest source code host in the world.&lt;br&gt;
It is a United States-based global company that provides hosting for software development and version control using Git.&lt;br&gt;
It offers the distributed version control and source code management functionality of Git, plus its own features.&lt;/p&gt;

&lt;p&gt;It provides access control and several collaboration features such as bug tracking, feature requests, task management, and wikis for every project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trust me, i know one of you is still wondering, What's the difference between Git and GitHub!!🤭🤭
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Git is a version control system while GitHub hosts your git repositories and puts them on your GitHub account making them accessible from anywhere across the internet.&lt;/li&gt;
&lt;li&gt;Git is a command line tool while GitHub is a website.&lt;/li&gt;
&lt;li&gt;Git is installed and maintained on your local system while, GitHub is a cloud based repository hosting service.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Can't be any simpler than that!!&lt;/p&gt;

&lt;p&gt;Please make sure you leave a like 👍/loveheart ❤️ on this one. It encourages one to write more and more 🎉 🎊&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>tutorial</category>
      <category>github</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Python Basics, Python 101</title>
      <dc:creator>EstherWanjiru</dc:creator>
      <pubDate>Sat, 24 Jul 2021 20:35:21 +0000</pubDate>
      <link>https://dev.to/estherwanjiru/python-basics-python-101-4a43</link>
      <guid>https://dev.to/estherwanjiru/python-basics-python-101-4a43</guid>
      <description>&lt;h1&gt;
  
  
  Python
&lt;/h1&gt;

&lt;p&gt;"Hello World!! Would be a perfect way to usher the world in to the now well known programming language," Guido van Rossum thought to himself in the 90's. &lt;/p&gt;

&lt;p&gt;And in 1991, Python was created as a simple, straight-forward yet a high-level language that is dynamically typed and targets on readability of code It's main purpose is to let you work quickly and integrate systems effectively. Python involves essential and object-oriented programming with wide-ranging and great typical library that has regular memory.&lt;/p&gt;

&lt;h2&gt;
  
  
  Advantages of Python
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Easy to Read, Learn and Write&lt;/strong&gt;&lt;br&gt;
Python has an English-like syntax. This makes it easier to read and understand the code. It is really easy to pick up and learn, that is why a lot of people recommend Python to beginners. You need less lines of code to perform the same task as compared to other major languages.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Improved Productivity&lt;/strong&gt;&lt;br&gt;
Python is a very productive language. Due to the simplicity of Python, developers can focus on solving the problem. You only write less code and get more things done.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Interpreted Language&lt;/strong&gt;&lt;br&gt;
Python is an interpreted language which means that it directly executes the code line by line. In case of any error, it stops further execution and reports back the error which has occurred.&lt;/p&gt;

&lt;p&gt;Python shows only one error even if the program has multiple errors. This makes debugging easier.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Dynamically Typed&lt;/strong&gt;&lt;br&gt;
Python doesn’t know the type of variable until we run the code. It automatically assigns the data type during execution. The programmer doesn’t need to worry about declaring variables and their data types.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Free and Open-Source&lt;/strong&gt;&lt;br&gt;
Python comes under the OSI approved open-source license. This makes it free to use and distribute. You can download the source code, modify it and even distribute your version of Python. This is useful for organizations that want to modify some specific behavior and use their version for development.&lt;/p&gt;
&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;Download the latest version of Python for your operating system here: &lt;a href="https://www.python.org/downloads/"&gt;https://www.python.org/downloads/&lt;/a&gt;. You can read more about setting up a python development using VS Code from this tutorial: &lt;a href="https://www.pythontutorial.net/getting-started/setup-visual-studio-code-for-python/"&gt;https://www.pythontutorial.net/getting-started/setup-visual-studio-code-for-python/&lt;/a&gt; by pythontutorial.net.&lt;/p&gt;
&lt;h2&gt;
  
  
  Let's get Started!
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Create a folder ie name it &lt;strong&gt;First Python Project&lt;/strong&gt; where all python files will be saved. Then launch the file in Visual Studio Code by using Git Bash by simply right-clicking on the folder and select Git Bash Here. &lt;strong&gt;In Git Bash, type code .&lt;/strong&gt;, it redirects the folder to Visual Studio Code which is the editor of choice in this case. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a python file. A python program has an extension of &lt;strong&gt;.py&lt;/strong&gt; For example you have index as the name of the python file, you will save it as index.py. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In our file, let's write our first line of code ie. &lt;strong&gt;"Hello World."&lt;/strong&gt;. We will write&lt;br&gt;
&lt;/p&gt;&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="k"&gt;print&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello World!"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The print() is a built-in function that displays a message on the screen. In this case, it’ll show the message "Hello, World!".&lt;/p&gt;
&lt;h2&gt;
  
  
  Execution
&lt;/h2&gt;

&lt;p&gt;When running the file in the terminal, you have to start by writing the python version on your computer which you can quickly confirm by writing&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="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;python&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;version&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and it will display it below. Now that we have the version, in my case it's Python3, so I'll write Python3 file_name(in my case it's index).py ie.&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="n"&gt;python3&lt;/span&gt; &lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;py&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Comments
&lt;/h2&gt;

&lt;p&gt;Comments can be used to explain Python code. Comments can be used to make the code more readable. Comments can be used to prevent execution when testing code. Comments starts with a #, and Python will ignore them.&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="c1"&gt;# single line comment
&lt;/span&gt;
&lt;span class="s"&gt;'''
multi line comment
multi line comment
'''&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Aritmetic Operators
&lt;/h2&gt;

&lt;p&gt;Operators are used to perform operations on variables and values.&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="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# 4 (addition)
&lt;/span&gt;&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# 1 (subtraction)
&lt;/span&gt;&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# 9 (multiplication)
&lt;/span&gt;&lt;span class="k"&gt;print&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;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# 4 (division)
&lt;/span&gt;&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# 256 (exponent)
&lt;/span&gt;&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# 1 (remainder of the division)
&lt;/span&gt;&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;11&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# 5 (floor division)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Variables
&lt;/h2&gt;

&lt;p&gt;Variables are containers for storing data values. Python has no command for declaring a variable. A variable is created the moment you first assign a value to 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="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;85&lt;/span&gt;
&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Ess"&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;NB&lt;/strong&gt; Variables do not need to be declared with any particular type, and can even change type after they have been set.&lt;/p&gt;

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

&lt;p&gt;Reference: &lt;a href="https://bit.ly/3iC9JuA"&gt;https://bit.ly/3iC9JuA&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In programming, a data type is an important concept. Variables can store data of different types, and different types can do different things. Python has the following data types built-in by default, in these categories:&lt;/p&gt;

&lt;p&gt;Text Type:       str&lt;br&gt;
Numeric Types:       int, float, complex&lt;br&gt;
Sequence Types:      list, tuple, range&lt;br&gt;
Mapping Type:        dict&lt;br&gt;
Set Types:       set, frozenset&lt;br&gt;
Boolean Type:        bool&lt;br&gt;
Binary Types:        bytes, bytearray, memoryview&lt;/p&gt;

&lt;p&gt;You can get the data type of any object by using the type() function:&lt;br&gt;
&lt;strong&gt;Example&lt;/strong&gt;&lt;br&gt;
Print the data type of the variable x:&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="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Strings
&lt;/h2&gt;

&lt;p&gt;Strings in python are surrounded by either single quotation marks, or double quotation marks.&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="s"&gt;'my love'&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;same&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="s"&gt;"my love"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can display a string literal with the print() function:&lt;/p&gt;

&lt;h2&gt;
  
  
  Lists
&lt;/h2&gt;

&lt;p&gt;Lists are used to store multiple items in a single variable. A list is one of 4 built-in data types in Python used to store collections of data, the other 3 are Tuple, Set, and Dictionary, all with different qualities and usage. They are ordered, changeable, and allow duplicate values.&lt;/p&gt;

&lt;p&gt;List items are indexed, the first item has index [0], the second item has index [1] etc.&lt;br&gt;
Lists are created using square brackets:&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="c1"&gt;#Example
#Create a List:
&lt;/span&gt;
&lt;span class="n"&gt;this_list&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"apple"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"banana"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"cherry"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;this_list&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Tuples
&lt;/h2&gt;

&lt;p&gt;Tuples are used to store multiple items in a single variable. A tuple is also one of 4 built-in data types in Python used to store collections of data, the other 3 are List, Set, and Dictionary, all with different qualities and usage.&lt;/p&gt;

&lt;p&gt;A tuple is a collection which is ordered and unchangeable.&lt;/p&gt;

&lt;p&gt;Tuples are written with round brackets.&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="c1"&gt;#Example
#Create a Tuple:
&lt;/span&gt;
&lt;span class="n"&gt;simple_outfit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"polo"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"jeans"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"sneakers"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;simple_outfit&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tuple items are indexed, the first item has index [0], the second item has index [1] etc.&lt;/p&gt;

&lt;h2&gt;
  
  
  Dictionaries
&lt;/h2&gt;

&lt;p&gt;Dictionaries are used to store data values in key:value pairs.&lt;br&gt;
A dictionary is a collection which is ordered*, changeable and does not allow duplicates.&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="c1"&gt;#Example
#Create and print a dictionary:
&lt;/span&gt;
&lt;span class="n"&gt;accessory&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="s"&gt;"item"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;"Watch"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s"&gt;"model"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;"Fjord"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s"&gt;"year"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2019&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;accessory&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Sets
&lt;/h2&gt;

&lt;p&gt;Sets store multiple items in a single variable. A set is one of 4 built-in data types in Python used to store collections of data, the other 3 are List, Tuple, and Dictionary, all with different qualities and usage.&lt;/p&gt;

&lt;p&gt;A set is a collection which is both unordered and unindexed. Sets are written with curly brackets.&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="n"&gt;Example&lt;/span&gt;
&lt;span class="n"&gt;Create&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;Set&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;

&lt;span class="n"&gt;thisset&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;"denim"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"poncho"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"barret"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Booleans
&lt;/h2&gt;

&lt;p&gt;Booleans represent one of two values: True or False.&lt;br&gt;
When you compare two values, the expression is evaluated and Python returns the Boolean answer:&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="n"&gt;Example&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1992&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1991&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1992&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1991&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1992&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1991&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Arrays
&lt;/h2&gt;

&lt;p&gt;An array is a special variable, which can hold more than one value at a time.&lt;/p&gt;

&lt;p&gt;If you have a list of items (a list of car names, for example), storing the cars in single variables could look like this:&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="n"&gt;car1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Ford"&lt;/span&gt;
&lt;span class="n"&gt;car2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Volvo"&lt;/span&gt;
&lt;span class="n"&gt;car3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"BMW"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, what if you want to loop through the cars and find a specific one? And what if you had not 3 cars, but 300?&lt;/p&gt;

&lt;p&gt;The solution is an array!&lt;/p&gt;

&lt;p&gt;An array can hold many values under a single name, and you can access the values by referring to an index number.&lt;/p&gt;

&lt;h2&gt;
  
  
  Functions
&lt;/h2&gt;

&lt;p&gt;A function is a block of code which only runs when it is called. You can pass data, known as parameters, into a function. The function then returns data as a result.&lt;br&gt;
In Python a function is defined using the def keyword:&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="n"&gt;Example&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;my_function&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
  &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello from a function"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Classes
&lt;/h2&gt;

&lt;p&gt;To create a class, use the keyword class:&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="n"&gt;Example&lt;/span&gt;
&lt;span class="n"&gt;Create&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;named&lt;/span&gt; &lt;span class="n"&gt;MyClass&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="nb"&gt;property&lt;/span&gt; &lt;span class="n"&gt;named&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MyClass&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To understand the meaning of classes and use them in real life applications, we have to understand the built-in &lt;strong&gt;init&lt;/strong&gt;() function.&lt;/p&gt;

&lt;p&gt;All classes have a function called &lt;strong&gt;init&lt;/strong&gt;(), which is always executed when the class is being initiated.&lt;/p&gt;

&lt;p&gt;Use the &lt;strong&gt;init&lt;/strong&gt;() function to assign values to object properties, or other operations that are necessary to do when the object is being created:&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="n"&gt;Example&lt;/span&gt;
&lt;span class="n"&gt;Create&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;named&lt;/span&gt; &lt;span class="n"&gt;Person&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="n"&gt;function&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;assign&lt;/span&gt; &lt;span class="n"&gt;values&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Person&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&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;age&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;
    &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;

&lt;span class="n"&gt;p1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Person&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Ess"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p1&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I find &lt;strong&gt;w3schools&lt;/strong&gt; very easy to explain and follow through, therefore i looped in a few definitions and examples from there to make it easy following through. I highly recommend this: &lt;a href="https://www.w3schools.com/python/default.asp"&gt;https://www.w3schools.com/python/default.asp&lt;/a&gt; to study a concept or two. &lt;/p&gt;

&lt;p&gt;It would be awesome getting feedback from a reader or three &lt;strong&gt;;)&lt;/strong&gt; &lt;/p&gt;

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