<?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: Donaldtweede</title>
    <description>The latest articles on DEV Community by Donaldtweede (@donaldtweede).</description>
    <link>https://dev.to/donaldtweede</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%2F811016%2Fd8144d76-ec89-4e35-9846-8125ef3fbb23.png</url>
      <title>DEV Community: Donaldtweede</title>
      <link>https://dev.to/donaldtweede</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/donaldtweede"/>
    <language>en</language>
    <item>
      <title>Introduction to Data Structures and Algorithms With Python</title>
      <dc:creator>Donaldtweede</dc:creator>
      <pubDate>Mon, 21 Feb 2022 04:26:38 +0000</pubDate>
      <link>https://dev.to/donaldtweede/introduction-to-data-structures-and-algorithms-with-python-2mcf</link>
      <guid>https://dev.to/donaldtweede/introduction-to-data-structures-and-algorithms-with-python-2mcf</guid>
      <description>&lt;p&gt;*&lt;em&gt;Understanding Data Structure *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Python has four inbuilt basic data structures which are:&lt;br&gt;
Lists, Dictionary, Tuple and Sets.&lt;br&gt;
To start with:&lt;/p&gt;

&lt;p&gt;Python List&lt;/p&gt;

&lt;p&gt;Lists define a set of values which are ordered in a sequence of elements enclosed in square brackets, [].The elements in a list can be changed otherwise said to be mutable.&lt;/p&gt;

&lt;p&gt;Example&lt;br&gt;
&lt;code&gt;myList = ["Rono", "Python", "Code"]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Lists can also be defined by using the keyword list()&lt;br&gt;
&lt;code&gt;numbers = list()&lt;br&gt;
numbers.append(4)&lt;br&gt;
numbers.append(5)&lt;br&gt;
numbers.append(6)&lt;br&gt;
print(numbers)&lt;br&gt;
[4, 5, 6]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;There are set of built-in methods used with lists.&lt;br&gt;
clear() - Removes the elements of a list&lt;br&gt;
copy() - Returns a copy of the list&lt;br&gt;
pop() - Removes the element at the specified position&lt;br&gt;
insert() - Adds an element at the specified position&lt;br&gt;
reverse() - Reverses the order of the list&lt;br&gt;
sort() - Sorts the list&lt;br&gt;
remove - removes the first item with the specified value&lt;br&gt;
count - returns the number of elements with the specified value.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Python Dictionaries&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Dictionaries referred to as hashmaps in other languages. It consists of key, value pairs. Key are unique and immutable objects.Each key and value pair are seperated by a colon.&lt;br&gt;
Dictionaries are defined by curly brackets {}.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;myDict = &lt;br&gt;
      {"name": Rono', &lt;br&gt;
       "Age":7, &lt;br&gt;
       "gender": 'male'&lt;br&gt;
      }&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;There are also a set of inbuilt python dictionary methods&lt;/p&gt;

&lt;p&gt;clear() - Removes all items from a dictionary&lt;br&gt;
copy() - Returns a copy of the dictionary&lt;br&gt;
get() - gets the value of the specified parameter&lt;br&gt;
items() - gets all items of a dictionary in the key value format&lt;br&gt;
popitem() - Removes and returns the last element in the dictionary&lt;br&gt;
update() - updates the dictionary with the key-value pairs&lt;br&gt;
keys() - returns a list containing the dictionary's keys&lt;br&gt;
values() - returns a list of all the values in the dictionary&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Python Tuples&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Tuples are used to store several items in a single variable.&lt;br&gt;
Tuples are unchangeable unlike lists and dictionaries. Meaning once you create a tuple you cannot alter its contents.&lt;br&gt;
They are also indexed from item [0] like in lists. Therefore you can access the tuple elements.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mytuple = ("cat", "mouse", "cow", "chicken")&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Tuples can be accessed through indexing&lt;/p&gt;

&lt;p&gt;`mytuple = ("cat", "mouse", "cow", "chicken")&lt;br&gt;
print(mytuple[1])&lt;/p&gt;

&lt;h1&gt;
  
  
  output:
&lt;/h1&gt;

&lt;p&gt;mouse`&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sets&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Sets are used to store multiples elements in a single variable within curly braces. They are unordered, unindexed and unchangeable.&lt;/p&gt;

&lt;p&gt;`mySet= {"pineapple", "pawpaw", "apple"}&lt;/p&gt;

&lt;p&gt;print(mySet)&lt;/p&gt;

&lt;p&gt;{'apple', 'pineapple', 'pawpaw'}`&lt;/p&gt;

&lt;p&gt;There are built-in set methods.&lt;/p&gt;

&lt;p&gt;add() - Adds an element to the set&lt;br&gt;
clear() - removes all the elements from the set&lt;br&gt;
copy() - returns a copy of the set&lt;br&gt;
discard() - removes the specified item&lt;br&gt;
pop() - removes an element from the set&lt;br&gt;
update() - updates the set with another set&lt;br&gt;
remove() - removes the specified item&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Algorithms Include:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Queues&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A queue is an abstract data structure that is open on both sides hence use first in first out basis FIFO.&lt;br&gt;
A queue has two ends; front and rear.The two operations involved with queues are enqueue and dequeue.&lt;br&gt;
Enqueue involves inserting items in a queue while dequeue is the process of removing items.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GBxjG1eD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/902x9rxk38pxq0f02n3c.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GBxjG1eD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/902x9rxk38pxq0f02n3c.jpg" alt="Image description" width="314" height="215"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Methods involved in queues include:&lt;br&gt;
push(item) - used to insert an element to the queue.&lt;br&gt;
pop(item) - used to remove an element from the queue.&lt;br&gt;
get() - used to extract an element from the queue.&lt;br&gt;
empty() - check whether a queue is empty or not.&lt;br&gt;
full() - check whether a queue is full.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stacks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Stacks is a linear data structure that stores data in a linear manner and an element is connected to the previous and next element. Elements are accessed in a Last In First Out order. The last element to be added is the first one to be retrieved.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LuoIbee3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uefa5mz8ll09azq2p2wf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LuoIbee3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uefa5mz8ll09azq2p2wf.png" alt="Image description" width="292" height="173"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Operations carried out in stacks are:&lt;br&gt;
empty() – Returns whether the stack is empty – Time Complexity: O(1)&lt;br&gt;
size() – Returns the size of the stack – Time Complexity: O(1)&lt;br&gt;
top() – Returns a reference to the topmost element of the stack – Time Complexity: O(1)&lt;br&gt;
push(a) – Inserts the element ‘a’ at the top of the stack – Time Complexity: O(1)&lt;br&gt;
pop() – Deletes the topmost element of the stack – Time Complexity: O(1)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Linked Lists&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A linked list is a sequence of data elements which are connected via links.Each link contains connection to another link.&lt;br&gt;
Python does not have linked lists in its standard library.&lt;br&gt;
The first node is also known as the HEAD. It is used as a reference to traverse the list.The last node points to NULL.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--V7hWh73s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1dqh68niwn6dsxsemw9l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--V7hWh73s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1dqh68niwn6dsxsemw9l.png" alt="Image description" width="619" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Types of Linked Lists&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Singly linked list&lt;br&gt;
Doubly linked list &lt;br&gt;
Circular singly linked list&lt;br&gt;
Circular Doubly linked list&lt;/p&gt;

&lt;p&gt;Thank you for reading this article i hope it has been helpfull.&lt;/p&gt;

</description>
      <category>python</category>
      <category>codenewbie</category>
      <category>luxacademy</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>python 101: Ultimate Python Guide</title>
      <dc:creator>Donaldtweede</dc:creator>
      <pubDate>Sun, 13 Feb 2022 10:36:08 +0000</pubDate>
      <link>https://dev.to/donaldtweede/python-101-ultimate-python-guide-5282</link>
      <guid>https://dev.to/donaldtweede/python-101-ultimate-python-guide-5282</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Python is a widely used general-purpose, high level programming language. It was created by &lt;strong&gt;Guido van Rossum&lt;/strong&gt; in 1991 and further developed by the Python Software Foundation. It was designed with an emphasis on code readability, and its syntax allows programmers to express their concepts in fewer lines of code. it is also referred to as general purpose programing language due to its wide range of applications such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data Analytics&lt;/li&gt;
&lt;li&gt;Data science&lt;/li&gt;
&lt;li&gt;Web development&lt;/li&gt;
&lt;li&gt;Machine learning&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Insatlling python&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before you start, you will need Python on your computer.Check whether you already have an up to date version of Python installed by entering python in a command line window. If you see a response from a Python interpreter it will include a version number in its initial display. Generally any Python 3.x version will do, as Python makes every attempt to maintain backwards compatibility within major Python versions. if you dont have it then you can download the installer from python.org.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Step1: download the installer&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
Open your favorite browser window and navigate to the python download page for Windows.&lt;br&gt;
Click on the link for the latest Python 3 Release.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step2: Run the installer&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Double-click on the downloaded .exe file and you should see the following window pop up;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;     ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uwbfu3gq5gbry93ojy62.jpg)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; Make sure to check the box that says add python 3 x to path to ensure that the install places the interpretor into your execution path.&lt;br&gt;
Click on Install now to install Python 3 and wait for the installation to finish.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;First python program&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now that we are done with python 3 installation, it's time time to write our first program.&lt;br&gt;
There are numerous IDE's and text editors to write Python code but in this tutorial we'll use Python's built'in IDLE.&lt;br&gt;
To open IDLE, type the following command in youe command prompt.&lt;br&gt;
&lt;code&gt;$ idle-python3.9&lt;/code&gt;&lt;br&gt;
IDLE opens a Python shell in a new window.&lt;br&gt;
The Python shell is an interactive environment that allows you to write python code and execute it imediately.&lt;br&gt;
This is we write our "Hello, world" program.&lt;br&gt;
To print out something in Python, we use the print() function.&lt;br&gt;
Type the code below in your interactive python shell.&lt;br&gt;
&lt;code&gt;print("hello,World!")&lt;/code&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ljbi6048wwairs9bwnz9.png)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Running our first code&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before running our code, we need to save it. Click on File then Save As and save your code as "introhello world.py".&lt;br&gt;
Notice the .py extension; that tells our intepretor that it is running a python code.&lt;br&gt;
After saving your code, click f5 to run.&lt;br&gt;
If all went well, the following window should appear;&lt;br&gt;
Hello world&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This was a tutorial on getting started with Python programming. We have gone through the installation provess and written our hello, world program.&lt;br&gt;
But there is more to Python programming than that.&lt;br&gt;
In the next article, we'll be looking at functions and variables.&lt;br&gt;
Thanks for your time.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>python</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
