<?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: Evans Van</title>
    <description>The latest articles on DEV Community by Evans Van (@evansvan).</description>
    <link>https://dev.to/evansvan</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F637811%2F615b69b8-786a-4c3e-884e-1d8f3d9e32d3.jpeg</url>
      <title>DEV Community: Evans Van</title>
      <link>https://dev.to/evansvan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/evansvan"/>
    <language>en</language>
    <item>
      <title>Introduction to Data Structures and Algorithms.</title>
      <dc:creator>Evans Van</dc:creator>
      <pubDate>Sun, 20 Feb 2022 07:02:10 +0000</pubDate>
      <link>https://dev.to/evansvan/introduction-to-data-structures-and-algorithms-3d2a</link>
      <guid>https://dev.to/evansvan/introduction-to-data-structures-and-algorithms-3d2a</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;A data structure is a particular way of organizing data in a computer so that it can be used effectively. Data Structures allows you to organize your data in such a way that enables you to store collections of data, relate them and perform operations on them accordingly.  Python features both built-in data structures such as lists, sets, dictionaries and tuples and user defined such as linked lists, trees and graphs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Built-in Data Structures
&lt;/h3&gt;

&lt;p&gt;These as the name suggest come out of the box in python making them easy to use and programming easier.Lets break them down better&lt;/p&gt;

&lt;h4&gt;
  
  
  Lists
&lt;/h4&gt;

&lt;p&gt;These are used to store data of the same type or different types in a sequential manner. They are indexed starting from 0 and the ending index is N-1 (If N elements are there). It also has negative indexing starting from -1 which allows you to access elements from last to first.&lt;br&gt;
List are created using square brackets if you don't pass any elements then you get an empty list.&lt;/p&gt;
&lt;h5&gt;
  
  
  List Manipulation and Functions
&lt;/h5&gt;

&lt;p&gt;List items can be accessed using the index values other list can also be modified using&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;append() adding all elements passed o it as a single element.&lt;/li&gt;
&lt;li&gt;Insert() takes an element and index, adds element to the index value and increases list size.&lt;/li&gt;
&lt;li&gt;Del which is a python keyword deletes element at index provided&lt;/li&gt;
&lt;li&gt;pop() function removes element from the indexed value.&lt;/li&gt;
&lt;li&gt;remove() this is used to remove an element using its value.&lt;/li&gt;
&lt;li&gt;len() returns length of the list.&lt;/li&gt;
&lt;li&gt;count() this function finds the count of the value passed to it.&lt;/li&gt;
&lt;li&gt;sort() and sorted() these functions do the same thing by sorting he list values. The sorted() has a return where as sort() modifies original list.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Examples&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;test = [1,2,'one','two']
test[0] # returns value at 0 index which is 1
test[-1] # returns the last value in the list 'two'

test.append(3) #adds 3 to end of list returns [1,2,'one','two',3]

test.insert(1,3) # adds element to index provided returns [1,3,2,'one','two']

del test[2] # deletes element at index 2 return [1,2,'two']

test.pop(1) #pops the element at provided index returns [1,'one','two']

test.remove('two') # removes the provided element returns [1,2,'one']

len(test) # returns length of list which is 3 here

test.count(2) # finds count of value passed which is 1 here
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Dictionaries
&lt;/h4&gt;

&lt;p&gt;These are used to store key-value pairs the data can be the same or of different types. Dictionaries are created using curly braces {} or using the dict() function.&lt;/p&gt;

&lt;h5&gt;
  
  
  Dictionary Manipulation and Functions
&lt;/h5&gt;

&lt;ol&gt;
&lt;li&gt;To change dictionary values you have to use the keys. So you firstly access the key and then change the value accordingly.&lt;/li&gt;
&lt;li&gt;To add values you simply just add another key-pair value.&lt;/li&gt;
&lt;li&gt;To delete items you use the pop function.&lt;/li&gt;
&lt;li&gt;To clear the dictionary you use the clear() function.&lt;/li&gt;
&lt;li&gt;To access elements in the dictionary you use the key values.&lt;/li&gt;
&lt;li&gt;You can also access the keys, values or all items of a dictionary using the key(), value() and items() functions.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Examples&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mydict= {} #initializes empty dict
mydict= {1:'one', 2:'two'} # dict with two elements
mydict[1] # returns (one)
mydict[3]= 'three' # {1:'one', 2:'two', 3:'three'}

mydict.pop(2) # returns {1:'one'}
mydict.clear() # returns an empty dict {}

mydict.keys() # gets keys returns  # (1,2)
mydict.values() # gets values returns  # (one,two)
mydict.items() # returns {1:'one', 2:'two'}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Sets
&lt;/h4&gt;

&lt;p&gt;Sets are an unordered collection of unique elements meaning that even if data is repeated more than once the set will only keep one value. Sets are created using the curly braces and just passing values.&lt;/p&gt;

&lt;h5&gt;
  
  
  Set Manipulation and Functions
&lt;/h5&gt;

&lt;ol&gt;
&lt;li&gt;add() this is used to add elements where you just pass the value you want added.&lt;/li&gt;
&lt;li&gt;union() this is used to combine data in the sets.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Examples&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;myset = {1.2.3,1} #returns {1,2,3} no duplicates allowed
myset.add(3) # returns {1,2,3,4}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Tuples
&lt;/h4&gt;

&lt;p&gt;Tuples are similar to list but are immutable this means that once created they cannot be modified. Just like a list ttuples can contain data of various types. Tuples are created using parenthesis or using the tuple() function.&lt;/p&gt;

&lt;h5&gt;
  
  
  Tuple Manipulation and Functions
&lt;/h5&gt;

&lt;ol&gt;
&lt;li&gt;Accessing items is done the same way as for lists.&lt;/li&gt;
&lt;li&gt;To add items you use the + which takes another tuple to be appended to it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Examples&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mytup = (1.2.3) 
mytup[1] # returns (2)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Conclusion
&lt;/h4&gt;

&lt;p&gt;This concludes the deep dive into the built-in methods for python.These are the primary methods used by most python programmers to create and manage their data, they also have a variety of functions apart from the ones i have described here used to manipulate data. In the next article we will deep dive into the user defined methods.  &lt;/p&gt;

</description>
      <category>python</category>
    </item>
    <item>
      <title>Python 101: Ultimate Python Guide or Introduction to Modern Python</title>
      <dc:creator>Evans Van</dc:creator>
      <pubDate>Tue, 15 Feb 2022 07:09:25 +0000</pubDate>
      <link>https://dev.to/evansvan/python-101-ultimate-python-guide-or-introduction-to-modern-python-7ld</link>
      <guid>https://dev.to/evansvan/python-101-ultimate-python-guide-or-introduction-to-modern-python-7ld</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Python is a high level programming language that was developed by Guido van Rossum.&lt;br&gt;
Python is meant to be an easily readable language. Its formatting is visually uncluttered, and it often uses English keywords where other languages use punctuation. Unlike many other languages, it does not use curly brackets to delimit blocks, and semicolons after statements are allowed but are rarely, if ever, used.&lt;br&gt;
It is also referred to as general purpose programming language due to its wide range of applications such as:&lt;/p&gt;

&lt;p&gt;Data Analytics&lt;/p&gt;

&lt;p&gt;Web Development&lt;/p&gt;

&lt;p&gt;Machine Learning &amp;amp; AI&lt;/p&gt;

&lt;p&gt;Wed Data Scraping&lt;/p&gt;

&lt;p&gt;Data Science&lt;/p&gt;

&lt;p&gt;Desktop Applications&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Types&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There are several data types in Python. The main data types that you’ll probably see the most are string, integer, float, list, dict and tuple.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;String
Strings are usually created in one of three ways. You can use single, double or triple quotes. Let’s take a look!.
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; my_string = "Welcome to Python!"
&amp;gt;&amp;gt;&amp;gt; another_string = 'The bright red fox jumped the fence.'
&amp;gt;&amp;gt;&amp;gt; a_long_string = '''This is a
multi-line string. It covers more than
one line'''
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;They can be manipulated in different ways through Concatenation, Replication, Slicing and other String Methods.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
a = 'Hello'
b = 'World'
#string Concatenation
a + b # returns HelloWorld
#string Replication
a * 3 # returns HelloHelloHello

len(a) # length of string -- in this case 5
b[0] #returns first letter - W
b[-1]#returns the last letter - d

a.upper()    #converts to uppercase HELLO
a.lower()    #converts to uppercase hello
b.title()    #converts to titlecase World
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.List&lt;br&gt;
A Python list is similar to an array in other languages. In Python, an empty list can be created in the following ways.&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; my_list = []
&amp;gt;&amp;gt;&amp;gt; my_list = list()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A list contains a list of elements, such as strings, integers, objects or a mixture of types. Let’s take a look at some examples:&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; my_list = [1, 2, 3]
&amp;gt;&amp;gt;&amp;gt; my_list2 = ["a", "b", "c"]
&amp;gt;&amp;gt;&amp;gt; my_list3 = ["a", 1, "Python", 5]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3.Tuples&lt;br&gt;
A tuple is similar to a list, but you create them with parentheses instead of square brackets. You can also use the tuple built-in. The main difference is that a tuple is immutable while the list is mutable. Let’s take a look at a few examples:&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; my_tuple = (1, 2, 3, 4, 5)
&amp;gt;&amp;gt;&amp;gt; my_tuple[0:3]
(1, 2, 3)
&amp;gt;&amp;gt;&amp;gt; another_tuple = tuple()
&amp;gt;&amp;gt;&amp;gt; abc = tuple([1, 2, 3])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4.Numeric&lt;br&gt;
These values can wither be integers, floats or complex numbers.&lt;/p&gt;

&lt;p&gt;5.Boolean&lt;br&gt;
These is either True or False. It can be used mainly for comparison operations and conditional statements.&lt;/p&gt;

&lt;p&gt;6.Dictionary&lt;br&gt;
Dictionaries are used to store data values in key:value pairs. A dictionary is created between two curly braces an integer or string can be the key or the value.&lt;/p&gt;

&lt;p&gt;A dictionary is a collection which is ordered*, changeable and do not allow duplicates.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dict = {1:'one', 'two':2}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;7.Sets&lt;br&gt;
Sets are unordered data structures that store unique elements.They are defined using {} no duplicates are allowed unlike tuples they are mutable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Running Python&lt;/strong&gt;&lt;br&gt;
Python comes with its own code editor: IDLE (Integrated Development and Learning Environment).&lt;br&gt;
It allows the programmer to write Python and debug their code quite easily. The reason it is a “lite” debugger is because it is very basic and it’s missing other features.&lt;br&gt;
It’s a Python shell where you can type short scripts and see their output immediately and even interact with code in real time. There is no compiling of the code as Python is an interpretive language and runs in the Python interpreter. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
This has been a beginner guide to python which is a great and easy programming language to learn as your first it is easy to read as it uses  English Keywords.Python is dynamically-typed and garbage-collected. It supports multiple programming paradigms, including structured,object-oriented and functional programming. It is often described as a "batteries included" language due to its comprehensive standard library.&lt;/p&gt;

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