<?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: Joshuauche</title>
    <description>The latest articles on DEV Community by Joshuauche (@joshuauche).</description>
    <link>https://dev.to/joshuauche</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%2F594189%2F4b599949-c136-45af-9d49-fa56dc8518be.jpeg</url>
      <title>DEV Community: Joshuauche</title>
      <link>https://dev.to/joshuauche</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/joshuauche"/>
    <language>en</language>
    <item>
      <title>Python: A Beginner's Guide to Data Structures and Algorithms</title>
      <dc:creator>Joshuauche</dc:creator>
      <pubDate>Mon, 21 Feb 2022 22:49:39 +0000</pubDate>
      <link>https://dev.to/joshuauche/python-a-beginners-guide-to-data-structures-and-algorithms-4e4o</link>
      <guid>https://dev.to/joshuauche/python-a-beginners-guide-to-data-structures-and-algorithms-4e4o</guid>
      <description>&lt;p&gt;&lt;strong&gt;what are Data structures&lt;/strong&gt;&lt;br&gt;
Data Structures are a remarkable way of organizing, managing and storing data in computers in such a way that we can perform operations on the saved data very efficiently.&lt;/p&gt;

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

&lt;p&gt;In this article, I will briefly explain the commonly used data structures in python every programmer must know.&lt;br&gt;
There are four types of built-in data structures in Python offers: list, tuple, set, and dictionary.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;List&lt;/strong&gt;&lt;/em&gt;&lt;br&gt;
A list is well defined using square brackets which holds data that is separated by commas. A list is mutable and ordered. It can contain a mix of different data types.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# declaring an empty lists
lists = []

# initializing and defining lists with different data types
list_Numbers = [1, 2, 3, 4, 5]

# initializing and defining lists with string data types
list_string = ["Bale", "Kane", "Sterling"]

# initializing and defining lists with mixed data types
mix_list = [9, 4, "Anne"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now lets try to access the data stored in the list using their index numbers, which begins count from 0 i.e. the first element in the list.&lt;br&gt;
open your python shell console&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; print the first element
&amp;gt;&amp;gt;&amp;gt; lists = [1, 2, 3, 4, 5]
&amp;gt;&amp;gt;&amp;gt; print(lists[0])
1
&amp;gt;&amp;gt;&amp;gt;
&amp;gt;&amp;gt;&amp;gt; print(lists[0:3])
[1, 2, 3]
&amp;gt;&amp;gt;&amp;gt;
&amp;gt;&amp;gt;&amp;gt; # prints the last element in the list
&amp;gt;&amp;gt;&amp;gt; print(lists[-1])

&amp;gt;&amp;gt;&amp;gt; # sorting the list in ascending order
&amp;gt;&amp;gt;&amp;gt; lists = [2, 7, 9, 3, 1]
&amp;gt;&amp;gt;&amp;gt; lists.sort()
&amp;gt;&amp;gt;&amp;gt; print(lists)
[1, 2, 3, 7, 9]
&amp;gt;&amp;gt;&amp;gt; 
&amp;gt;&amp;gt;&amp;gt; # sorting the list in descending order
&amp;gt;&amp;gt;&amp;gt; lists.sort(reverse=True)
&amp;gt;&amp;gt;&amp;gt; print(lists)
[9, 7, 3, 2, 1]
&amp;gt;&amp;gt;&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;since list are mutable, we can perform addition and deletion of element in list.&lt;br&gt;
to add more elements we can use these functions: append(), extend(), and insert().&lt;br&gt;
to delete elements, we can use del(), pop() and remove() function&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Tuples&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
A tuple is  a data type for storing immutable ordered sequences of elements. tuples are Immutable because you can neither add nor remove elements from tuples, or sort them in place unlike lists which are mutable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; # declaring an empty tuple
&amp;gt;&amp;gt;&amp;gt; emptY_tuple = ()
&amp;gt;&amp;gt;&amp;gt; print(empty_tuple)
()

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;Set&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
Set is a mutable and unordered collection of unique elements. It can permit us to remove duplicate quickly from a list.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Dictionaries&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
Dictionary is a mutable and unordered data structure, used to store data. It permits storing a pair of items which are in keys and values.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; Dict1 = {1: 'Hello', 2: 'To', 3: 'You'}
&amp;gt;&amp;gt;&amp;gt; print(Dict1)
{1: 'Hello', 2: 'To', 3: 'You'}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;User-Defined Data structure&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;&lt;em&gt;stacks&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
A stack is a LIFO (Last In First Out — the element placed at last can be accessed at first) data structure which can be commonly found in many programming languages. This structure is named as “stack”. example of stack is in &lt;/p&gt;

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

&lt;p&gt;Operations carried out on stack are push and pop.&lt;br&gt;
push is used in inserting an element into the stack&lt;br&gt;
pop is used in deleting an element in the stack&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Queues&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
Queues is a also a linear data structure which uses First-In/First Out(FIFO) to store items.&lt;/p&gt;

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

&lt;p&gt;Operations that can be performed on the queue are:&lt;br&gt;
Enqueue - which is used to add item to the queues&lt;br&gt;
Dequeue - It removes an item from the queue&lt;br&gt;
Front -  the front item from the queue&lt;br&gt;
Rear - the last item from the queue&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Binary Trees&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
Trees are also non-linear data structures that represent nodes connected by edges. Each Tree consists of a root node from which we can access each element of the tree.&lt;/p&gt;

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

&lt;p&gt;There are other data structures which can be implemented linked list, graphs and hash tables.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Algorithms&lt;/strong&gt;&lt;br&gt;
Algorithm is a step-by-step course of action, which defines a set of instructions to be executed in a certain order to get the desired output. Algorithms are generally created independent of underlying languages&lt;/p&gt;

&lt;p&gt;the common operations that can be done are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Search&lt;/li&gt;
&lt;li&gt;Sort&lt;/li&gt;
&lt;li&gt;Insert&lt;/li&gt;
&lt;li&gt;Delete&lt;/li&gt;
&lt;li&gt;Update&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are three main approaches in solving an algorithm&lt;br&gt;
Greedy Algorithm&lt;br&gt;
Dynamic Algorithm&lt;br&gt;
Divide and conquer Algorithm&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.google.com/url?sa=i&amp;amp;url=https%3A%2F%2Fintellipaat.com%2Fblog%2Ftutorial%2Fpython-tutorial%2Fdata-structures-with-python-cheat-sheet%2F&amp;amp;psig=AOvVaw3cDRoqhfQgVk_oGdzqPnJl&amp;amp;ust=1645563970045000&amp;amp;source=images&amp;amp;cd=vfe&amp;amp;ved=2ahUKEwiFyLHQ2ZH2AhU8_rsIHenHDpcQr4kDegUIARCnAQ" rel="noopener noreferrer"&gt;https://www.google.com/url?sa=i&amp;amp;url=https%3A%2F%2Fintellipaat.com%2Fblog%2Ftutorial%2Fpython-tutorial%2Fdata-structures-with-python-cheat-sheet%2F&amp;amp;psig=AOvVaw3cDRoqhfQgVk_oGdzqPnJl&amp;amp;ust=1645563970045000&amp;amp;source=images&amp;amp;cd=vfe&amp;amp;ved=2ahUKEwiFyLHQ2ZH2AhU8_rsIHenHDpcQr4kDegUIARCnAQ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.google.com/url?sa=i&amp;amp;url=https%3A%2F%2Fwww.programiz.com%2Fdsa%2Fstack&amp;amp;psig=AOvVaw2T5OGqPtqkDe7BuB325GD6&amp;amp;ust=1645568362317000&amp;amp;source=images&amp;amp;cd=vfe&amp;amp;ved=2ahUKEwi2yeT-6ZH2AhU9i_0HHVIMAX0Qr4kDegUIARC7AQ" rel="noopener noreferrer"&gt;https://www.google.com/url?sa=i&amp;amp;url=https%3A%2F%2Fwww.programiz.com%2Fdsa%2Fstack&amp;amp;psig=AOvVaw2T5OGqPtqkDe7BuB325GD6&amp;amp;ust=1645568362317000&amp;amp;source=images&amp;amp;cd=vfe&amp;amp;ved=2ahUKEwi2yeT-6ZH2AhU9i_0HHVIMAX0Qr4kDegUIARC7AQ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.google.com/url?sa=i&amp;amp;url=https%3A%2F%2Fwww.delftstack.com%2Fhowto%2Fpython%2Ftrees-in-python%2F&amp;amp;psig=AOvVaw1Nzy6BTVm4IlHi13UlVBGX&amp;amp;ust=1645569306571000&amp;amp;source=images&amp;amp;cd=vfe&amp;amp;ved=2ahUKEwjIn4XB7ZH2AhWSD-wKHYXTC58Qr4kDegUIARCGAg" rel="noopener noreferrer"&gt;https://www.google.com/url?sa=i&amp;amp;url=https%3A%2F%2Fwww.delftstack.com%2Fhowto%2Fpython%2Ftrees-in-python%2F&amp;amp;psig=AOvVaw1Nzy6BTVm4IlHi13UlVBGX&amp;amp;ust=1645569306571000&amp;amp;source=images&amp;amp;cd=vfe&amp;amp;ved=2ahUKEwjIn4XB7ZH2AhWSD-wKHYXTC58Qr4kDegUIARCGAg&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>python</category>
      <category>algorithms</category>
    </item>
    <item>
      <title>Python 101: Ultimate Python Guide or Introduction to Modern Python</title>
      <dc:creator>Joshuauche</dc:creator>
      <pubDate>Sat, 12 Feb 2022 18:44:13 +0000</pubDate>
      <link>https://dev.to/joshuauche/python-101-ultimate-python-guide-or-introduction-to-modern-python-3b89</link>
      <guid>https://dev.to/joshuauche/python-101-ultimate-python-guide-or-introduction-to-modern-python-3b89</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is Python?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. Its high-level built in data structures, combined with dynamic typing and dynamic binding, make it very attractive for Rapid Application Development.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What makes python so popular?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It is simple and easy to learn syntax.&lt;/li&gt;
&lt;li&gt;Debugging Python programs is easy&lt;/li&gt;
&lt;li&gt;increased productivity it provides&lt;/li&gt;
&lt;li&gt;It’s beginner friendly.&lt;/li&gt;
&lt;li&gt;It’s open source.&lt;/li&gt;
&lt;li&gt;It’s versatile.&lt;/li&gt;
&lt;li&gt;Python has a large and active community&lt;/li&gt;
&lt;li&gt;It has archive of modules and libraries&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What types of jobs use Python?&lt;/strong&gt;&lt;br&gt;
Since python is a general-purpose language, it’s used across a variety of fields and industries. These are just a few job titles that may use Python:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Developer&lt;/li&gt;
&lt;li&gt;Data analyst&lt;/li&gt;
&lt;li&gt;Data scientist&lt;/li&gt;
&lt;li&gt;Ethical hacker/penetration tester&lt;/li&gt;
&lt;li&gt;Software engineer&lt;/li&gt;
&lt;li&gt;Data journalist&lt;/li&gt;
&lt;li&gt;Cloud architect&lt;/li&gt;
&lt;li&gt;QA engineer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What is Python used for?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;developing websites and software&lt;/li&gt;
&lt;li&gt;task automation&lt;/li&gt;
&lt;li&gt;data analysis&lt;/li&gt;
&lt;li&gt;data visualization&lt;/li&gt;
&lt;li&gt;Software testing and prototyping&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Python installation steps&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Visit &lt;a href="https://www.python.org/downloads/"&gt;https://www.python.org/downloads/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Select your Operating system(Windows, Linux, MacOS)&lt;/li&gt;
&lt;li&gt;Select the release or version, click on it to download.&lt;/li&gt;
&lt;li&gt;Double click on the file to execute and install.&lt;/li&gt;
&lt;li&gt;For window mark “add to system paths”
For more check on the &lt;a href="https://docs.python.org/3"&gt;python documentation&lt;/a&gt; for more documentations.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Let’s test our installed python&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open Terminal on Linux or cmd on windows&lt;/li&gt;
&lt;li&gt;Run the python --version command to check if you installed the correct version.
if python is installed, the output will be similar to as below:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C:\Users\UCHE&amp;gt;python --version
Python 3.9.7

C:\Users\UCHE&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;we can now open python interpreter shell on the terminal with this command. the output will be similar to as below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C:\Users\UCHE&amp;gt;python
Python 3.9.7 (tags/v3.9.7:1016ef3, Aug 30 2021, 20:19:38) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
&amp;gt;&amp;gt;&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Our first code is to print hello world using python.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; print("Hello, World!")
Hello, World!
&amp;gt;&amp;gt;&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, lets read from user input, declare it in a variable and print&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; name = input("enter your name: ")
enter your name: Bale
&amp;gt;&amp;gt;&amp;gt; print("hello, " + name)
hello, Bale
&amp;gt;&amp;gt;&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;we can also use a code editor and IDEs(Integrated Development Environment) to write our python code.&lt;br&gt;
Here are the list of best python IDEs and code editors&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.jetbrains.com/pycharm/"&gt;PyCharm&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://code.visualstudio.com/"&gt;Visual Studio Code&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.sublimetext.com/2"&gt;Sublime Text&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://atom.io/"&gt;Atom&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://jupyter.org/"&gt;Jupyter Notebook&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.eclipse.org/"&gt;Eclipse + PyDev + LiClipse&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.vim.org/"&gt;Vim&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.gnu.org/software/emacs/"&gt;GNU Emacs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.spyder-ide.org/"&gt;Spyder&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://thonny.org/"&gt;Thonny&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.activestate.com/products/komodo-ide/"&gt;Komodo Edit&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.coursera.org/articles/what-is-python-used-for-a-beginners-guide-to-using-python"&gt;https://www.coursera.org/articles/what-is-python-used-for-a-beginners-guide-to-using-python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://lzomedia.com/blog/python-101-introduction-to-modern-python/"&gt;https://lzomedia.com/blog/python-101-introduction-to-modern-python/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.python.org/doc/essays/blurb/"&gt;https://www.python.org/doc/essays/blurb/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>python</category>
      <category>opensource</category>
      <category>tutorial</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
