<?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: Owino</title>
    <description>The latest articles on DEV Community by Owino (@owino).</description>
    <link>https://dev.to/owino</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%2F811049%2F231cd540-00ae-4b35-a370-31c6ea2c782e.jpg</url>
      <title>DEV Community: Owino</title>
      <link>https://dev.to/owino</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/owino"/>
    <language>en</language>
    <item>
      <title>Python for everyone : Mastering Python The Right Way </title>
      <dc:creator>Owino</dc:creator>
      <pubDate>Mon, 07 Mar 2022 17:00:54 +0000</pubDate>
      <link>https://dev.to/owino/python-for-everyone-mastering-python-the-right-way-1e8d</link>
      <guid>https://dev.to/owino/python-for-everyone-mastering-python-the-right-way-1e8d</guid>
      <description>&lt;p&gt;Python is a high-level programming language that is easy for everyone to learn due to its simple syntax.&lt;br&gt;
Beginners will take a shorter period of time to be up and running!&lt;/p&gt;

&lt;p&gt;It is widely used in web and APIs development, cryptography, games development, scripting (automation) tasks, artificial intelligence, data science, web scrapping (crawling) and many other areas.&lt;/p&gt;

&lt;p&gt;In this blog post, I will explore the areas you need to cover all the way from beginner, intermediate and into advanced level. Thereafter, I will also highlight various specialization areas that you may need to look at depending on your area of interest.&lt;br&gt;
I will also highlight some of the popular free Python learning resources.&lt;/p&gt;

&lt;p&gt;The best practice on how to master Python programming just like any other programming language is to ensure you execute one or more project after each level before proceeding onto next levels. Think of any idea that you can implement using the concepts you have covered after during the completed level and make it you project.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Beginner Level&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;At this level ensure you cover and understand the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Application areas of Python&lt;/li&gt;
&lt;li&gt;Downloading and Installing Python&lt;/li&gt;
&lt;li&gt;User interfaces or IDEs like the ones listed below. Pick and use one of your desired IDEs while working with Python:

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.jetbrains.com/pycharm/promo/"&gt;Pycharm&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://code.visualstudio.com/"&gt;Visual Studio Code Editor&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.spyder-ide.org/"&gt;Spyder IDE&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.sublimetext.com/"&gt;Sublime Text&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.pydev.org/"&gt;PyDev&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Program structure&lt;/li&gt;
&lt;li&gt;Interactive shell&lt;/li&gt;
&lt;li&gt;Executables or script files&lt;/li&gt;
&lt;li&gt;Variables&lt;/li&gt;
&lt;li&gt;Data types&lt;/li&gt;
&lt;li&gt;Conditions&lt;/li&gt;
&lt;li&gt;Chained conditions&lt;/li&gt;
&lt;li&gt;Control flow&lt;/li&gt;
&lt;li&gt;Loops and Iteration&lt;/li&gt;
&lt;li&gt;Data structures ( Lists, Tuples, Sets and Dictionaries)&lt;/li&gt;
&lt;li&gt;Functions&lt;/li&gt;
&lt;li&gt;Common Methods&lt;/li&gt;
&lt;li&gt;File input/output&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This gives you a good base but before you proceed onto the next level, you have a milestone checkpoint (a project!).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Beginner Level Project&lt;/strong&gt; : Think of a project or task you can accomplish using the concepts you have covered so far.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Intermediate Level&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here you need to explore the following key aspects of Python programming language:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Object Oriented Programming (classes and object, Encapsulation, Inheritance and Polymorphism) &lt;/li&gt;
&lt;li&gt;Lambda functions&lt;/li&gt;
&lt;li&gt;*args AND **kwargs in function definitions&lt;/li&gt;
&lt;li&gt;pip (package installer for Python)&lt;/li&gt;
&lt;li&gt;Virtual programming environments&lt;/li&gt;
&lt;li&gt;Modules&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Intermediate Level Project&lt;/strong&gt; : Think of a project or task you can accomplish using the concepts you have covered so far including the beginner level concepts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Advanced Level&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Concepts you need to cover and understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; Decorators&lt;/li&gt;
&lt;li&gt; Generators&lt;/li&gt;
&lt;li&gt; Testing (unittest, nose(or nose2) and pytest)&lt;/li&gt;
&lt;li&gt; &lt;a href="https://www.python.org/dev/peps/pep-0008/"&gt;PEP 8 - Styling Guide for Python code&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt; Packaging your python application&lt;/li&gt;
&lt;li&gt; Cython&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Advanced Level Project&lt;/strong&gt; : Think of a project or task you can accomplish using the concepts you have covered so far all the way from beginner to the advanced.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Specialization Areas&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After going through basic, intermediate and into advanced levels, you may decide to choose one or more of the areas to go deeper into the key application areas of Python programming language.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.1 Web and APIs development&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In web development explore the following Python web frameworks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://flask.palletsprojects.com/en/2.0.x/"&gt;Flask (with Jinja2)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.djangoproject.com/"&gt;Django&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://fastapi.tiangolo.com/"&gt;FastAPI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.pylonsproject.org/projects/pyramid/en/latest/index.html"&gt;Pyramid&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://turbogears.org/"&gt;TurboGears&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cherrypy.dev/"&gt;CherryPy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://web2py.com/"&gt;web2py&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://bottlepy.org/docs/dev/"&gt;Bottle&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aiohttp.org/en/stable/"&gt;AIOHTTP&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.cubicweb.org/"&gt;CubicWeb&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dash.plotly.com/"&gt;Dash&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://falcon.readthedocs.io/en/stable/"&gt;Falcon&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://giotto.readthedocs.io/en/latest/index.html"&gt;Giotto&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pypi.org/project/growler/"&gt;Growler&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.hug.rest/"&gt;Hug&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://morepath.readthedocs.io/en/latest/"&gt;Morepath&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://pycnic.nullism.com/"&gt;Pycnic&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://sanic.dev/en/"&gt;Sanic&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4.2 Cryptography&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We have several libraries in Python that provides cryptographic recipes and primitives to python developers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://pypi.org/project/M2Crypto/"&gt;M2Crypto&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pypi.org/project/pycrypto/"&gt;PyCrypto&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.pyopenssl.org/"&gt;pyOpenSSL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pypi.org/project/python-nss/"&gt;python-nss&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://botan.randombit.net/handbook/api_ref/python.html"&gt;Botan’s Python bindings&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4.3 Games development&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For games development enthusiasts, Python provides the following libraries / frameworks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/pygame/pygame"&gt;Pygame&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pykyra.updatestar.com/"&gt;Pykyra&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://pyglet.org/"&gt;Pyglet&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://pyopengl.sourceforge.net/"&gt;PyOpenGL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://kivy.org/doc/stable/"&gt;Kivy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.panda3d.org/"&gt;Panda3D&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.cocos2d.org/"&gt;Coco2D&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://wiki.ogre3d.org/Python-Ogre"&gt;Python Ogre&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.renpy.org/"&gt;Ren'Py&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pypi.org/project/arcade/"&gt;Arcade&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4.4 Scripting (automation) tasks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In case in systems administration, you will need to create Python code in files, make the files executable.&lt;br&gt;
This helps to automate routine tasks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.5 Artificial Intelligence(AI)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's look at the libraries / frameworks that Python offers for AI areas: Machine Learning (ML), Compute Vision, Natural Language Processing (NLP), Neural Networks, Robotics, Fuzzy logic and Expert systems.&lt;/p&gt;

&lt;p&gt;4.5.1 Machine Learning&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://scikit-learn.org/stable/"&gt;scikit-learn&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.tensorflow.org/"&gt;TensorFlow&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pytorch.org/docs/stable/index.html"&gt;PyTorch&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://xgboost.readthedocs.io/en/stable/"&gt;XGBoost&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://matplotlib.org/"&gt;matplotlib&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;4.5.2 Computer Vision&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.fast.ai/"&gt;fastai&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://opencv.org/"&gt;OpenCV&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://simplecv.org/"&gt;SimpleCV&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.opensourceagenda.com/projects/dockerface"&gt;Dockerface&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pypi.org/project/imutils/"&gt;imutils&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.reactivip.com/image-processing/"&gt;IPSDK&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://keras.io/"&gt;Keras&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://matplotlib.org/"&gt;matplotlib&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://scikit-image"&gt;scikit-image&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pypi.org/project/pytorchcv/"&gt;PyTorchCV&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pypi.org/project/pytesseract/"&gt;Python-tesseract&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://cmusatyalab.github.io/openface/"&gt;OpenFace&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ukoethe.github.io/vigra/doc-release/vigranumpy/index.html"&gt;Vigranumpy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pypi.org/project/face-recognition/"&gt;face-recognition&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://albumentations.ai/docs/"&gt;albumentations&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;4.5.3 Natural Language Processing&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.nltk.org/"&gt;NLTK&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://spacy.io/"&gt;Spacy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pypi.org/project/gensim/"&gt;Gensim&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;4.5.4 Neural Networks&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://pypi.org/project/fann2/"&gt;faan2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pypi.org/project/ffnet/"&gt;ffnet&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pytorch.org/docs/stable/index.html"&gt;PyTorch&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;4.5.5 Robotics&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/robotframework/robotframework"&gt;Robot Framework&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/irmen/Pyro4"&gt;Pyro (Python Remote Objects)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://dartsim.github.io/"&gt;DART (Dynamic Animation and Robotics Tookkit)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pypi.org/project/pyrobot/"&gt;PyRobot&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/pydy/pydy"&gt;PyDy (Python Dynamics)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/sofa-framework/sofa"&gt;SOFA (Simulation Open Framework Architecture )&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://motion.cs.illinois.edu/klampt/"&gt;Klamp't (Kris's Locomotion and Manipulation Toolkit)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pypi.org/project/pybotics/"&gt;Pybotics&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/siconos/siconos"&gt;Sinocos&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/robotology/idyntree/blob/master/README.md"&gt;iDynTree&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;4.5.6 Fuzzy Logic&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://pypi.org/project/fuzzylogic/"&gt;fuzzylogic&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pypi.org/project/simpful/"&gt;simpful&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/scikit-fuzzy/scikit-fuzzy"&gt;scikit-fuzzy&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;4.5.6 Expert Systems&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://pypi.org/project/pyclips/"&gt;pyclips&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pypi.org/project/experta/"&gt;experta&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4.6 Data science&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://bokeh.org/"&gt;Bokeh&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://matplotlib.org/"&gt;matplotlib&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://numpy.org/doc/stable/"&gt;NumPy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://scipy.org/"&gt;SciPy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pandas.pydata.org/"&gt;pandas&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://scikit-learn.org/stable/"&gt;scikit-learn&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.tensorflow.org/"&gt;TensorFlow&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4.7 Web scrapping (crawling)&lt;/strong&gt;&lt;br&gt;
As web is text-based platform, Python has libraries for working with JSON, HTML, XML and other formats.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://pypi.org/project/requests/"&gt;requests&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pypi.org/project/beautifulsoup4/"&gt;BeautifulSoup&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://scrapy.org/"&gt;Scrappy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://mechanicalsoup.readthedocs.io/en/stable/"&gt;MechanicalSoup&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.selenium.dev/"&gt;Selenium&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://docs.pyspider.org/en/latest/"&gt;Pyspider&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4.8 GUI Based desktop applications&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In order to develop desktop GUI applications, Python provides the following capabilities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://wiki.python.org/moin/PyQt"&gt;PyQt&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.python.org/3/library/tkinter.html"&gt;tkinter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.wxpython.org/"&gt;wxPython&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://kivy.org/doc/stable/"&gt;Kivy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pypi.org/project/PySide/"&gt;PySide&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5 Learning Resources&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;While learning, choose a particular resource and stick to it. Avoid hopping from one learning resource to the the other. Below I am sharing some of the common Python learning resources.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5.1 Websites&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://automatetheboringstuff.com/"&gt;Automate the boring stuff&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.freecodecamp.org/"&gt;Freecodecamp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.geeksforgeeks.org/"&gt;geeksforgeeks&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.tutorialspoint.com/"&gt;Tutorialspoint&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.studytonight.com/"&gt;studytonight&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.javatpoint.com/"&gt;javatpoint&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.sololearn.com/home"&gt;sololearn&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.w3schools.com/python/"&gt;w3schools&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.guru99.com/"&gt;guru99&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pythonspot.com/"&gt;Pythonspot&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.learnpython.org/"&gt;Learnpython&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pythontutor.com/"&gt;Python Tutor&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.fullstackpython.com/"&gt;Full Stack Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.programiz.com/"&gt;Programiz&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5.2 Youtube Channels&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/c/Freecodecamp"&gt;Freecodecamp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/channel/UC2KfmYEM4KCuA1ZurravgYw"&gt;Amigoscode&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/c/TechWithTim"&gt;Tech with Tim&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/channel/UCkw4JCwteGrDHIsyIIKo4tQ"&gt;Edureka&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/channel/UC59K-uG2A5ogwIrHw4bmlEg"&gt;Telusko&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/channel/UC29ju8bIPH5as8OGnQzwJyA"&gt;Traversy Media&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5.3 Books&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Beginners&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.amazon.co.uk/Automate-Boring-Stuff-Python-2nd/dp/1593279922/ref=sr_1_1?crid=2IL5LR7KOCSYK&amp;amp;keywords=automate+the+boring+stuff+with+python&amp;amp;qid=1646650594&amp;amp;sprefix=automate+%2Caps%2C56&amp;amp;sr=8-1"&gt;Automate The Boring Stuff with Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.amazon.co.uk/Python-Crash-Course-2nd-Edition/dp/1593279280/ref=sr_1_1?crid=1NN3QCS8RT0UN&amp;amp;keywords=python+crash+course&amp;amp;qid=1646650741&amp;amp;s=books&amp;amp;sprefix=python+crash%2Cstripbooks%2C62&amp;amp;sr=1-1"&gt;Python Crash Course&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.amazon.co.uk/Learn-Python-Hard-Way-Introduction/dp/0134692888/ref=sr_1_1?crid=2WWK8DQB4BCJQ&amp;amp;keywords=learn+python+3+the+hard+way&amp;amp;qid=1646650768&amp;amp;s=books&amp;amp;sprefix=Learn+Python+%2Cstripbooks%2C56&amp;amp;sr=1-1"&gt;Learn Python 3 the Hard Way&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Intermediate&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.amazon.co.uk/Fluent-Python-Luciano-Ramalho/dp/1491946008/ref=sr_1_1?crid=1USAE5HVZOWJA&amp;amp;keywords=fluent+python&amp;amp;qid=1646650857&amp;amp;s=books&amp;amp;sprefix=FLUENT%2Cstripbooks%2C49&amp;amp;sr=1-1"&gt;Fluent Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.amazon.co.uk/Effective-Python-Specific-Software-Development/dp/0134853989/ref=sr_1_1?crid=2XJASNE5MZVUY&amp;amp;keywords=effective+python&amp;amp;qid=1646650898&amp;amp;s=books&amp;amp;sprefix=effective+python%2Cstripbooks%2C35&amp;amp;sr=1-1"&gt;Effective Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.amazon.co.uk/Python-Cookbook-David-Beazley/dp/1449340377/ref=sr_1_1?crid=WA0W55V9TKM9&amp;amp;keywords=python+cookbook&amp;amp;qid=1646650980&amp;amp;s=books&amp;amp;sprefix=python+coo%2Cstripbooks%2C49&amp;amp;sr=1-1"&gt;Python Cookbook&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5.4 Coding Practice&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For code challenges and practices you can check out the following websites:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.hackerrank.com/"&gt;HackerRank&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.codewars.com/"&gt;Codewars&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://exercism.org/"&gt;Exercism&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.codechef.com/"&gt;Codechef&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://leetcode.com/"&gt;Leetcode&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.hackerearth.com/"&gt;HackerEarth&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://codeforces.com/"&gt;Codeforces&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.codingame.com/start"&gt;CodeinGame&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://codingbat.com/python"&gt;Codingbat&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;6. Python Project Ideas&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can check out below list of project ideas that you can try to using Python programming language.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Quiz app&lt;/li&gt;
&lt;li&gt;Calculator&lt;/li&gt;
&lt;li&gt;Web automation&lt;/li&gt;
&lt;li&gt;Classic snake game&lt;/li&gt;
&lt;li&gt;Web crawler&lt;/li&gt;
&lt;li&gt;Music Player&lt;/li&gt;
&lt;li&gt;Instagram Bot&lt;/li&gt;
&lt;li&gt;Twitter Bot&lt;/li&gt;
&lt;li&gt;Reddit Bot&lt;/li&gt;
&lt;li&gt;Alarm Clock&lt;/li&gt;
&lt;li&gt;Image downloader&lt;/li&gt;
&lt;li&gt;Face recognition&lt;/li&gt;
&lt;li&gt;URL shortener&lt;/li&gt;
&lt;li&gt;File explorer&lt;/li&gt;
&lt;li&gt;Notification system&lt;/li&gt;
&lt;li&gt;File rename tool&lt;/li&gt;
&lt;li&gt;Password generator&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;7. Free platforms to host your test applications&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Incase you need to host your trial applications, check the below  free platforms:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/"&gt;Github pages&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.netlify.com/"&gt;Netlify&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.heroku.com/"&gt;Heroku&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://firebase.google.com/"&gt;Firebase&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://vercel.com/"&gt;Vercel&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.pythonanywhere.com/"&gt;pythonanywhere&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Key takeaways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Practice, practice and practice! code everyday.&lt;/li&gt;
&lt;li&gt;Choose a study resource that suits you and stick to it.&lt;/li&gt;
&lt;li&gt;Do projects before moving to the next level.&lt;/li&gt;
&lt;li&gt;Document your learning journey in a blog since you learn more when you share.&lt;/li&gt;
&lt;li&gt;Use code version control like Git/Github, bitbucket etc for all your code that you write.&lt;/li&gt;
&lt;li&gt;Never stop learning.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Feel free to leave comments. Thank you! &lt;/p&gt;

&lt;p&gt;Oh, I almost forgot, please checkout an &lt;a href="https://github.com/emwadun/instagram-video-and-photos-downloader"&gt;instagram-video-and-photos-downloader&lt;/a&gt; I created. It is one of my projects.&lt;/p&gt;

</description>
      <category>python</category>
      <category>datascience</category>
      <category>machinelearning</category>
      <category>ai</category>
    </item>
    <item>
      <title>Introduction to Data Structures and Algorithms With Python</title>
      <dc:creator>Owino</dc:creator>
      <pubDate>Mon, 21 Feb 2022 20:54:00 +0000</pubDate>
      <link>https://dev.to/owino/introduction-to-data-structures-and-algorithms-with-python-1k34</link>
      <guid>https://dev.to/owino/introduction-to-data-structures-and-algorithms-with-python-1k34</guid>
      <description>&lt;p&gt;Following my previous post on Python concepts &lt;a href="https://dev.to/owino/python-101-ultimate-python-guide-bkc"&gt;Python 101: Ultimate Python Guide&lt;/a&gt;, I am excited to dive into the following aspects of python.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A Data structure&lt;/strong&gt; &lt;em&gt;is a method of organizing data in a system. Think of sequences of number, or tables of data: these are both well-defined data structures.&lt;/em&gt;&lt;br&gt;
Python data structures are: Lists, Dictionaries, Tuples and Sets.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;An Algorithm&lt;/strong&gt; &lt;em&gt;is a sequence of steps executed by a computer that takes some input and transforms into a target output.&lt;/em&gt;&lt;br&gt;
Examples of algorithms that we will discuss in Python are: Queues, Stacks and Linked Lists.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Data structures:&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
I had covered some of these data structured but for those who haven't visited my previous post &lt;a href="https://dev.to/owino/python-101-ultimate-python-guide-bkc"&gt;Python 101: Ultimate Python Guide&lt;/a&gt;, let's look at them.&lt;br&gt;
&lt;strong&gt;1 - Lists&lt;/strong&gt;&lt;br&gt;
Lists in python is in other terms what other programming languages call arrays. Lists are mutable i.e. their elements can be changed, removed, new ones added etc. &lt;br&gt;
Lists are used if you have collection of data that does not need random access.&lt;br&gt;
The elements in a list are enclosed in &lt;strong&gt;square "[]" brackets&lt;/strong&gt;. see below examples:&lt;br&gt;
Here we declare a list named &lt;strong&gt;myFriends&lt;/strong&gt; and use it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;myFriends = ["Mike", "John", "Peter", "Lenny", "Peter"]
print(myFriends)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When we run our python program it will print out the below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;['Mike', 'John', 'Peter', 'Lenny', 'Peter']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To count all my friends called 'Peter':&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print(myFriends.count("Peter"))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Let's insert a friend to the list at index 1 of the list and print the list again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print(myFriends.insert(1,"Arnold"))
print(myFriends
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;['Mike', 'Arnold', 'John', 'Peter', 'Lenny', 'Peter']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's remove Friend 'Lenny' from the list and print the list once more:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print(myFriends.remove("Lenny"))
print(myFriends)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;['Mike', 'Arnold', 'John', 'Peter', 'Peter']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Feel free to try out other list functions available in Python such as: clear(), copy(), extend(), index(), pop(), reverse() and sort().&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2 - Dictionaries&lt;/strong&gt;&lt;br&gt;
Dictionaries are used to store data in key:value format.&lt;br&gt;
Dictionaries are mutable.&lt;br&gt;
You will need to use dictionaries if:&lt;br&gt;
i - You need logical association between a key-value pair data.&lt;br&gt;
ii - You need first lookup of your data based on a key.&lt;br&gt;
iii - Your data is constantly being modified.&lt;br&gt;
See below code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;student = {
    "firstName" : "Mark",
    "Age" : 23,
    "Hobby" : "Soccer"
}
print(student)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output will be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{'firstName': 'Mark', 'Age': 23, 'Hobby': 'Soccer'}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To print out the value of key Hobby in the student dictionary:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print(student["Hobby"])
#also the below code will do the same
print(student.get("Hobby"))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3 - Tuples&lt;/strong&gt;&lt;br&gt;
Tuples are similar to list but their contents cannot be changed; they are &lt;strong&gt;immutable&lt;/strong&gt;.&lt;br&gt;
Therefore tuples are used for cases where the data does not need to be changed e.g. geographical coordinates etc.&lt;br&gt;
The elements in a tuple are enclosed in &lt;strong&gt;round brackets "()"&lt;/strong&gt;.&lt;br&gt;
See below example with our tuple named &lt;strong&gt;daysOfTheWeek&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;daysOfTheWeek = ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")
print(daysOfTheWeek)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output when we run above:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To print the third element of the tuple:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print(daysOfTheWeek[3])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;If we try to change any element of the tuple e.g. assigning a new value to element at index 1:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;daysOfTheWeek[1] = "Friday"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Python will throw the following TypeError since elements in a tuple cannot be changed (tuples are immutable):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;TypeError: 'tuple' object does not support item assignment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4 - Sets&lt;/strong&gt;&lt;br&gt;
Sets are unordered collections of unique objects.&lt;br&gt;
Items in the set are unordered so they cannot be indexed, it either an item is in the set or not.&lt;br&gt;
Sets elements are defined in &lt;strong&gt;curl braces "{}"&lt;/strong&gt;.&lt;br&gt;
Sets are used if you need uniqueness of the elements.&lt;br&gt;
Let's declare a set 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;basket ={'apple', 'orange', 'apple', 'pear', 'orange', 'banana'}
print(basket)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The printout will remove duplicates and only unique items will be displayed i.e.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{'pear', 'apple', 'banana', 'orange'}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can add an item to a set and print the current set:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;basket.add('Pineapple')
print(basket)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here you can see we now have an additional element to the set being shown:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{'Pineapple', 'pear', 'apple', 'orange', 'banana'}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are other set functions like &lt;strong&gt;clear()&lt;/strong&gt;, &lt;strong&gt;pop()&lt;/strong&gt;, &lt;strong&gt;copy()&lt;/strong&gt;, &lt;strong&gt;difference()&lt;/strong&gt;, &lt;strong&gt;discard()&lt;/strong&gt;,  &lt;strong&gt;intersection()&lt;/strong&gt;, &lt;strong&gt;issubset()&lt;/strong&gt;, &lt;strong&gt;issuperset()&lt;/strong&gt; etc please try them out.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Algorithms:&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;strong&gt;1 - Queues&lt;/strong&gt;&lt;br&gt;
A queue is a linear data structure that stores its elements in FIFO (First-In/First-out) manner.&lt;br&gt;
Just like a queue of customers to be served in a supermarket, the ones who came first will be served first.&lt;br&gt;
Python list is used as a way of implementing queues. The list’s append() and pop() methods can insert and delete elements from the queue. &lt;br&gt;
Lets initialize an empty queue, add three element and prints it out:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;myQueue = []

myQueue.append('Duncan')
myQueue.append('Owino')
myQueue.append('Mwamba')

print(myQueue)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can now see our queue has elements:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;['Duncan', 'Owino', 'Mwamba']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lets dequeue (remove) elements from the queue:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;myQueue.pop(0)
myQueue.pop(0)
myQueue.pop(0)

print(myQueue)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we have our queue as empty:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2 - Stack&lt;/strong&gt;&lt;br&gt;
A stack is a linear data structure that stores items in LIFO (Last-In/First-Out) or FILO (First-In/Last-Out).&lt;br&gt;
In a stack, a new element is added at one end and the element is removed from that end only.&lt;br&gt;
The insert operation is called append() while the delete operation is called pop().&lt;/p&gt;

&lt;p&gt;Lets declare an empty stack and append three elements into it and print the stack:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;myStack = []

myStack.append('Duncan')
myStack.append('Owino')
myStack.append('Mwamba')
print(myStack)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output will be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;['Duncan', 'Owino', 'Mwamba']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now lets pop an element from the stack and print the stack:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;myStack.pop()
print(myStack)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The elements of the stack now are:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;['Duncan', 'Owino']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see we have deleted element ['Mwamba'] from the stack.&lt;/p&gt;

&lt;p&gt;Other operation/functions with stacks are: empty(), size(), top() etc. Please try them out.&lt;br&gt;
&lt;strong&gt;3 - Linked List&lt;/strong&gt;&lt;br&gt;
A Linked list is an ordered collection of objects called nodes.&lt;br&gt;
Each element of a linked list is called a node.&lt;br&gt;
Every node has two different fields:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Data&lt;/em&gt; : This contains the value to be stored in the node.&lt;br&gt;
 &lt;em&gt;Next&lt;/em&gt; : This contains a reference to the next node on the list.&lt;/p&gt;

&lt;p&gt;Here’s what a typical node looks like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pi759cs4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ya1hbuhes5mo0rm4jsbj.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pi759cs4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ya1hbuhes5mo0rm4jsbj.PNG" alt="A node" width="304" height="197"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The first node is called the &lt;strong&gt;head&lt;/strong&gt;, and it’s used as the starting point for any iteration through the list. The last node must have its next reference pointing to &lt;strong&gt;None&lt;/strong&gt; to determine the end of the list. &lt;br&gt;
Therefore here is how a linked list looks:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DMDONkUS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2w1afu3xi457lkzjwvq2.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DMDONkUS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2w1afu3xi457lkzjwvq2.PNG" alt="A linked list" width="715" height="221"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are many other algorithms that can be explored i.e. Hashtable, tree, graphs, sorting and searching, greedy algorithm ...&lt;/p&gt;

&lt;p&gt;Please share your comments and feedback. Thank you!&lt;/p&gt;

</description>
      <category>programming</category>
      <category>python</category>
      <category>algorithms</category>
      <category>datascience</category>
    </item>
    <item>
      <title>Python 101: Ultimate Python Guide</title>
      <dc:creator>Owino</dc:creator>
      <pubDate>Mon, 14 Feb 2022 08:28:18 +0000</pubDate>
      <link>https://dev.to/owino/python-101-ultimate-python-guide-bkc</link>
      <guid>https://dev.to/owino/python-101-ultimate-python-guide-bkc</guid>
      <description>&lt;p&gt;Working in Cloud Orchestration, automation skills are vital; python lends a hand to this. Python is easy to learn!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Python?&lt;/strong&gt;&lt;br&gt;
Python is a high-level programming language. It can be used in scripting/automation, Artificial Intelligence(AI), Machine language (ML), Data Science, APIs and web development. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My Programming environment and setup&lt;/strong&gt;&lt;br&gt;
As I share this, below find my setup and programming environment:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Windows 10 64-bit. Python code can also be executed on other OS platforms e.g. Linux, macOS.&lt;/li&gt;
&lt;li&gt;Python 3.8 (&lt;a href="https://www.python.org/downloads/release/python-380/"&gt;https://www.python.org/downloads/release/python-380/&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;IDE &amp;amp; Code Editor: I use Visual Studio Code (&lt;a href="https://code.visualstudio.com/"&gt;https://code.visualstudio.com/&lt;/a&gt;). You can also opt to use other code editors of your choice like PyCharm, Idle, Sublime Text3, Spyder, Jupyter, Eclipse etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Follow me along as I take you through an exciting journey needed to keep you up and running in Python. Feel free to type the code as we get along. I will try to will make it as simple as possible!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Overview of Python&lt;/strong&gt;&lt;br&gt;
Variables and Datatypes, Comments in Python, How to get input from users, Operators, Data structures (lists, tuples and dictionaries), functions and control flow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Variables and Datatypes&lt;/strong&gt;&lt;br&gt;
Python supports the following data types:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Strings&lt;/li&gt;
&lt;li&gt;Numbers&lt;/li&gt;
&lt;li&gt;Boolean&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The below example shows how to use these three variables in Python. My file is saved as  &lt;strong&gt;variables_and_datatypes.py&lt;/strong&gt; in Visual studio code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Lets declare three variables names firstName, age and isMale all of different data type.
firstName = 'Mel' 
age = 10
isFemale = True

print(firstName) #This will print out Mel
print(age)       #This Will print out 10
print(isFemale)  #This will print out True
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Comments in Python&lt;/strong&gt;&lt;br&gt;
It is very important to comment your line(s) of code as it helps others understand  your code. &lt;br&gt;
Moreover this helps you incase you come back to that section to see what you did days, months or even years later since it is easy to forget what your did days back.&lt;br&gt;
You can use &lt;strong&gt;single line comment&lt;/strong&gt; &lt;em&gt;using #&lt;/em&gt; or &lt;strong&gt;multi-line comments&lt;/strong&gt; by &lt;em&gt;having text between a block of ''' '''&lt;/em&gt; . See below example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
'''
This is my first program.
Python is a high-level programming language.
Here am using multi-line comment style.
'''

#This prints out strings to the user. Here I have used single line comment.
print('Python programming is fun!')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Getting input from users&lt;/strong&gt;&lt;br&gt;
Incase you need your program to get inputs from users, you need to use python input function. See below example on how this function is used.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;'''
Here we are using input function to get name of the user and 
store in a variable named firstName'''
firstName = input("Enter your name: ")

'''
In this case are converting string input to an integer.
By default all inputs in Python are treated as strings so we have to convert them to our desired data type; in this case an integer.
'''

age = int(input("Enter your age: "))

#Here we concatenate(link together) the strings using f-string during printing to make a meaningful sentence.
print(f"Your name is: {firstName} and your {age}")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Below is what I will get if I run my python file named &lt;strong&gt;input.py&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Enter your name: Mel
Enter your age: 10
Your name is: Mel and your 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4. Python Operators: Let's build a basic calculator&lt;/strong&gt;&lt;br&gt;
To perform mathematical operations in python, we use the following operators: + (for addition), - (for subtraction), * (for multiplication), ** (for exponentials) / (for division), % (for modulus),  / (for division) and // (for quotient.&lt;br&gt;
See below code snipped for the example of our simple calculator:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;firstNumber = float(input("Enter the FIRST number: "))
secondNumber = float(input("Enter the SECOND number: "))

sum = firstNumber + secondNumber
print(f"The sum of {firstNumber} and {secondNumber} is {sum}")

multiplication = firstNumber * secondNumber
print(f"The product of {firstNumber} and {secondNumber} is {multiplication}")

exponential = firstNumber ** secondNumber
print(f"{firstNumber} raised to the power of {secondNumber} is {exponential}")

division = firstNumber / secondNumber
print(f"The Division of {firstNumber} by {secondNumber} is {division}")

subtraction = firstNumber - secondNumber
print(f"The Subtraction of {secondNumber} from {firstNumber} is {subtraction}")

modulus = firstNumber % secondNumber
print(f"The Modulus of {secondNumber} and {firstNumber} is {modulus}")

quotient = firstNumber // secondNumber
print(f"The quotient of {firstNumber} and {secondNumber} is {quotient}")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;See the below output when we run our Python file named &lt;strong&gt;calculator.py&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Enter the FIRST number: 4
Enter the SECOND number: 2
The sum of 4.0 and 2.0 is 6.0
The product of 4.0 and 2.0 is 8.0
4.0 raised to the power of 2.0 is 16.0
The Division of 4.0 by 2.0 is 2.0
The Subtraction of 2.0 from 4.0 is 2.0
The Modulus of 2.0 and 4.0 is 0.0
The quotient of 4.0 and 2.0 is 2.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;5. Data structures in Python&lt;/strong&gt;&lt;br&gt;
You also need to understand the key data structures in Python. These are &lt;strong&gt;Lists&lt;/strong&gt;, &lt;strong&gt;Tuples&lt;/strong&gt; and &lt;strong&gt;Dictionaries&lt;/strong&gt;. Let's go through each one:&lt;/p&gt;

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

&lt;p&gt;Lists in python is in other terms what other programming languages call arrays. Lists are mutable i.e. their elements can be changed, removed, new ones added etc. The elements in a list are enclosed in &lt;strong&gt;square "[]" brackets&lt;/strong&gt;. see below examples:&lt;br&gt;
Here we declare a list named &lt;strong&gt;myFriends&lt;/strong&gt; and use it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;myFriends = ["Mike", "John", "Peter", "Lenny", "Peter"]
print(myFriends)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When we run our python program it will print out the below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;['Mike', 'John', 'Peter', 'Lenny', 'Peter']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To count all my friends called 'Peter':&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print(myFriends.count("Peter"))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Let's insert a friend to the list at index 1 of the list and print the list again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print(myFriends.insert(1,"Arnold"))
print(myFriends
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;['Mike', 'Arnold', 'John', 'Peter', 'Lenny', 'Peter']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's remove Friend 'Lenny' from the list and print the list once more:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print(myFriends.remove("Lenny"))
print(myFriends)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;['Mike', 'Arnold', 'John', 'Peter', 'Peter']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Feel free to try out other list functions available in Python such as: clear(), copy(), extend(), index(), pop(), reverse() and sort().&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5.2 Tuples&lt;/strong&gt;&lt;br&gt;
Tuples are similar to list but their contents cannot be changed; they are &lt;strong&gt;immutable&lt;/strong&gt;.&lt;br&gt;
The elements in a tuple are enclosed in &lt;strong&gt;round brackets "()"&lt;/strong&gt;.&lt;br&gt;
See below example with our tuple named &lt;strong&gt;daysOfTheWeek&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;daysOfTheWeek = ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")
print(daysOfTheWeek)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output when we run above:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To print the third element of the tuple:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print(daysOfTheWeek[3])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;If we try to change any element of the tuple e.g. assigning a new value to element at index 1:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;daysOfTheWeek[1] = "Friday"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Python will throw the following TypeError since elements in a tuple cannot be changed (tuples are immutable):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;TypeError: 'tuple' object does not support item assignment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;5.3 Dictionaries&lt;/strong&gt;&lt;br&gt;
Dictionaries are used to store data in key:value format.&lt;br&gt;
See below code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;student = {
    "firstName" : "Mark",
    "Age" : 23,
    "Hobby" : "Soccer"
}
print(student)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output will be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{'firstName': 'Mark', 'Age': 23, 'Hobby': 'Soccer'}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To print out the value of key Hobby in the student dictionary:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print(student["Hobby"])
#also the below code will do the same
print(student.get("Hobby"))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;6. Functions&lt;/strong&gt;&lt;br&gt;
A function is a set of code which execute a particular logic in your program. For example you could be having multiple lines of code which are geared to perform a certain function in you program. To make it easier to maintain your program and also to call/refer that particular block of code in your program, you need to implement functions. Functions help to decompose a program (&lt;strong&gt;modular programming&lt;/strong&gt;).&lt;br&gt;
Functions in Python are declared using key word &lt;strong&gt;def&lt;/strong&gt;. Lets explore a simple example of a function in Python. Please take note of the comments in the program:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def getUserInputs():
    #Here we are making sure that these variables are scoped even outside the function.
    global firstName, lastName, age  

    firstName = input("Enter your first name: ")
    lastName = input("Enter your last name: ")
    age = int(input("Enter your age: "))

#Now we are calling the function in our program.
getUserInputs()

print(f"Your name is {firstName} {lastName} and you are {age} years old")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output with test inputs will yield the below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Enter your first name: James
Enter your last name: Michael
Enter your age: 23
Your name is James Michael and you are 23 years old
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;7. Control Flow&lt;/strong&gt;&lt;br&gt;
Python supports the following logical conditions(operators):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Equals: a == b&lt;/li&gt;
&lt;li&gt;Not Equals: a != b&lt;/li&gt;
&lt;li&gt;Less than: a &amp;lt; b&lt;/li&gt;
&lt;li&gt;Less than or equal to: a &amp;lt;= b&lt;/li&gt;
&lt;li&gt;Greater than: a &amp;gt; b&lt;/li&gt;
&lt;li&gt;Greater than or equal to: a &amp;gt;= b&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These logical operators are used in various flow control mechanisms in Python. Let's use them  in below cases:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7.1 If...else statements&lt;/strong&gt;&lt;br&gt;
For If statements, if the condition at the logical check is &lt;strong&gt;True&lt;/strong&gt;, only that block of code gets executed. Lets see below code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x = 4
y = 42

if x &amp;gt; y:
    print(f"{x} is greater than {y}")
elif x &amp;lt; 42:
    print(f"({x} is less than  {y})")
else:
    print(f"{x} is equal to {y}")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(4 is less than  42)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;7.2 While loop&lt;/strong&gt;&lt;br&gt;
For while loop, a block of code will continue to be executed as long as the condition remains &lt;strong&gt;True&lt;/strong&gt;. For example the values printed will 0, 1, 2, 3, 4 and 5. It will stop there since 6 will not satisfy the condition; it will be &lt;strong&gt;False&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;i = 0 #Here we have initialized our variable i to value 0.

while i &amp;lt;= 5:
    print(i)
    i = i + 1 # Here we are incrementing our value of i by 1 each time.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output when we run the above program will be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0
1
2
3
4
5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;7.3 For loop&lt;/strong&gt;&lt;br&gt;
For loop is nice for iterating through a list, tuple or dictionary. see below example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;myFriends = ["Mike", "John", "Peter", "Lenny", "Peter"]

for name in myFriends:
    print(name)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output will be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Mike
John
Peter
Lenny
Peter
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;8. Let's improve our calculator&lt;/strong&gt;&lt;br&gt;
Now lets improve our calculator. We will use most of the concepts we have learned so far including functions and control flow.&lt;br&gt;
See below code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;firstNumber = input("Enter the first number: ")
operator = input("Enter the operator ('+,*,-,/ or %) you want to use: ")
secondNumber = input("Enter the second number: ")

def calc(firstNumber, operator, secondNumber):
    if operator == "+":
       return (float(firstNumber) + float(secondNumber))
    elif operator == "*":
       return (float(firstNumber) * float(secondNumber))
    elif operator == "-":
       return (float(firstNumber) - float(secondNumber))
    elif operator == "/":
       return (float(firstNumber) / float(secondNumber))
    elif operator == "%":
       return (float(firstNumber) % float(secondNumber))   
    else:
       return print("Invalid operator")  

result = calc(firstNumber, operator, secondNumber)

print(f"{firstNumber} {operator} {secondNumber} equals {result}")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;9. Let's put all we have learn in practice: Fibanocci sequence numbers!&lt;/strong&gt;&lt;br&gt;
Now to spice things up let's try to explore Fibanocci sequence numbers.&lt;br&gt;
&lt;em&gt;The Fibonacci sequence is the series of numbers where each number is the sum of the two preceding numbers. For example, 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610 etc.&lt;/em&gt;&lt;br&gt;
I created a program to check if a number is a Fibanocci number.&lt;br&gt;
Please check it out on my github: &lt;a href="https://github.com/emwadun/fibanocciCheck"&gt;https://github.com/emwadun/fibanocciCheck&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;What's next on my mind?&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
In this blog post, I have tried to keep it as simple as possible to address only the core concepts. Please feel free to review, comment and share some feedback.&lt;/p&gt;

&lt;p&gt;On my next blog post I will explore the following aspects in Python: &lt;br&gt;
[x] Reading files&lt;br&gt;
[x] Writing to files&lt;br&gt;
[x] Modules and PIP&lt;br&gt;
[x] Classes and Objects&lt;br&gt;
[x] Object Functions&lt;br&gt;
[x] Inheritance&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



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