<?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: FRANCIS ODERO</title>
    <description>The latest articles on DEV Community by FRANCIS ODERO (@oderofrancis).</description>
    <link>https://dev.to/oderofrancis</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%2F810404%2Fe233ca2c-9b97-4574-884c-964fe0d34bf5.jpeg</url>
      <title>DEV Community: FRANCIS ODERO</title>
      <link>https://dev.to/oderofrancis</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/oderofrancis"/>
    <language>en</language>
    <item>
      <title>Django</title>
      <dc:creator>FRANCIS ODERO</dc:creator>
      <pubDate>Sun, 19 Nov 2023 07:56:12 +0000</pubDate>
      <link>https://dev.to/oderofrancis/django-392e</link>
      <guid>https://dev.to/oderofrancis/django-392e</guid>
      <description>&lt;p&gt;Django is a powerful and versatile web framework that allows you to build web applications quickly and efficiently. In this blog post, I will show you how to get started with Django web development and create a simple blog app.&lt;/p&gt;

&lt;p&gt;First, you need to install Django on your system. You can use pip, a package manager for Python, to do that. Open a terminal and run the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pip install django&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will install the latest version of Django on your system. You can check the version by running:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;django-admin --version&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Next, you need to create a project folder and a Django project. A project is a collection of settings, apps, and files that make up your web application. To create a project, run the following command in your terminal:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;django-admin startproject blog_project&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will create a folder called blog_project with some files inside it. The most important file is manage.py, which is used to run various commands for your project.&lt;/p&gt;

&lt;p&gt;Now, you need to create an app inside your project. An app is a component of your web application that handles a specific functionality, such as blog posts, users, comments, etc. To create an app, run the following command in your terminal:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;python manage.py startapp blog_app&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will create a folder called blog_app with some files inside it. The most important file is models.py, which is used to define the data models for your app.&lt;/p&gt;

&lt;p&gt;A data model is a representation of the data that you want to store in your database. For example, for a blog app, you might want to store information about blog posts, such as title, content, author, date, etc. To define a data model, you need to use the Django ORM (Object-Relational Mapper), which is a layer of abstraction that allows you to interact with the database using Python code.&lt;/p&gt;

&lt;p&gt;To define a data model for blog posts, open the models.py file in your blog_app folder and add the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from django.db import models
from django.contrib.auth.models import User

class Post(models.Model):
    title = models.CharField(max_length=100)
    content = models.TextField()
    author = models.ForeignKey(User, on_delete=models.CASCADE)
    date = models.DateTimeField(auto_now_add=True)

    def __str__(self):
        return self.title
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This code defines a class called Post that inherits from models.Model, which is the base class for all Django data models. The class has four attributes: title, content, author, and date. Each attribute is an instance of a field class that defines the type and constraints of the data. For example, title is a CharField that can store up to 100 characters, content is a TextField that can store unlimited text, author is a ForeignKey that references another model (User), and date is a DateTimeField that automatically sets the current date and time.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;str&lt;/strong&gt; method is a special method that returns a human-readable representation of the object. In this case, it returns the title of the post.&lt;/p&gt;

&lt;p&gt;After defining the data model, you need to register it with the admin site. The admin site is a built-in feature of Django that allows you to manage your data through a web interface. To register the Post model with the admin site, open the admin.py file in your blog_app folder and add the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from django.contrib import admin
from .models import Post

admin.site.register(Post)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This code imports the Post model from models.py and registers it with admin.site.&lt;/p&gt;

&lt;p&gt;Now, you need to create the database tables for your data model. To do that, you need to run two commands: makemigrations and migrate. Makemigrations creates migration files that store the changes you made to your data model. Migrate applies those changes to the database. Run the following commands in your terminal:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;python manage.py makemigrations&lt;/code&gt;&lt;br&gt;
&lt;code&gt;python manage.py migrate&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will create and apply the migrations for your Post model.&lt;/p&gt;

&lt;p&gt;At this point, you have successfully created a Django project, an app, and a data model for blog posts. You can now run the development server and access the admin site. Run the following command in your terminal:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;python manage.py runserver&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will start the development server on &lt;a href="http://127.0.0.1:8000/" rel="noopener noreferrer"&gt;http://127.0.0.1:8000/&lt;/a&gt;. To access the admin site, go to &lt;a href="http://127.0.0.1:8000/admin/" rel="noopener noreferrer"&gt;http://127.0.0.1:8000/admin/&lt;/a&gt; and log in with the username and password you created when you ran migrate for the first time.&lt;/p&gt;

&lt;p&gt;You should see something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;![Django admin site](https://docs.djangoproject.com/en/3.2/_images/admin01.png)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can click on Posts to add, edit, or delete blog posts using the admin interface.&lt;/p&gt;

&lt;p&gt;Congratulations! You have just created a simple blog app using Django web development.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>The Django way ...</title>
      <dc:creator>FRANCIS ODERO</dc:creator>
      <pubDate>Wed, 20 Jul 2022 07:35:22 +0000</pubDate>
      <link>https://dev.to/oderofrancis/the-django-way--215a</link>
      <guid>https://dev.to/oderofrancis/the-django-way--215a</guid>
      <description>&lt;h2&gt;
  
  
  Django web framework
&lt;/h2&gt;

&lt;p&gt;Django is a web framework written in Python (although it’s not limited to Python) that allows developers to build web applications more easily. It has a great community of users and developers, and it provides over 800 pre-defined actions in a model, and 1300 actions in a view. Django makes it very easy to write web applications that behave like websites, but with much more power, flexibility, and security.&lt;/p&gt;

&lt;h2&gt;
  
  
  History of Django
&lt;/h2&gt;

&lt;p&gt;Django started as a project developed by a Django web development company: Stuck in Customs. Stuck in Customs CEO, Daniel Gultsch, started the project to make things easier for his team. Once Django was available, Stuck in Customs would submit it to their community to get feedback. Since the team had developed Django, it became easy for them to develop.&lt;/p&gt;

&lt;p&gt;The project quickly grew beyond a simple web application framework, and Django’s founders made a website for the Django community. Soon, over 100 people downloaded the framework each day. The number of Django contributors grew, as well. The Django community eventually became a legal entity: the Django Software Foundation.&lt;/p&gt;

&lt;p&gt;Django was originally released under the GNU General Public License (GPL). It is now licensed under the Apache License 2.0.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Django is flexible enough to fit any web application.&lt;/li&gt;
&lt;li&gt;Django is modern. It’s based on a modern design pattern called “Model-View-Template” (MVT).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Django comes with a built-in web server. So, unlike Django, you don’t need to install Apache, Nginx, or IIS, etc. in order to run Django.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Django
&lt;/h2&gt;

&lt;p&gt;The recommended way to install Django is to use pip. Install it with:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ pip install django&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Or, if you don’t have pip, you can install it with:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ easy_install django&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Installing Django creates a Django project, so you’ll need to create a virtualenv (or run Python with --prefix), and then activate it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Running Django
&lt;/h2&gt;

&lt;p&gt;Python projects run in a virtualenv by default.&lt;/p&gt;

&lt;p&gt;Create a directory and access the directory&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mkdir dj&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;then&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cd dj&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Create a virtualenv for your project:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ virtualenv django&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Activate the virtualenv:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ source django/bin/activate&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;create a&lt;code&gt;requirements.txt&lt;/code&gt; file&lt;/p&gt;

&lt;p&gt;&lt;code&gt;touch  requirements.txt&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Install Django in your virtualenv that you created.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pip install django==3.2&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Create a django project:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;django-admin startproject mysite .&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will create django project in the same folder as we have included a dot at the end &lt;code&gt;.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;python manage.py migrate&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then run your project:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ python manage.py runserver&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will run Django’s built-in web server on port 8000.&lt;/p&gt;

&lt;p&gt;You can test your project by visiting &lt;a href="http://localhost:8000/" rel="noopener noreferrer"&gt;http://localhost:8000/&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Django comes with built-in support for SSL. All you have to do is tell Django which certificates to use for the server and clients, and then run:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ python manage.py runserver -h 0.0.0.0&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you want to connect to your Django project from another computer, either use SSH tunneling or run a local port forward.&lt;/p&gt;

&lt;p&gt;Django comes with built-in support for SSL.&lt;/p&gt;

&lt;h2&gt;
  
  
  Web Pages
&lt;/h2&gt;

&lt;p&gt;Django includes built-in support for templating. And, it’s a lightweight template language, so you can run Django locally without installing anything else.&lt;/p&gt;

&lt;p&gt;Templates (or just templates) are files that define how your web page should look. Django comes with two templates: django template.defaults and django.template.loaders.seq. By default, django template.defaults is an alias for django.template.loaders.seq.&lt;br&gt;
This plays an important role in MVT structure as Django framework efficiently handles and generates dynamically HTML web pages that are visible to the end-user.&lt;/p&gt;

&lt;p&gt;Thank you for your Time &lt;br&gt;
Let's meet next on the next section of &lt;a href="https://dev.to/oderofrancis/python-django-web-framework-3fh9"&gt;creating Django application&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>python</category>
      <category>django</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Mastering Python The Right Way.</title>
      <dc:creator>FRANCIS ODERO</dc:creator>
      <pubDate>Thu, 03 Mar 2022 13:19:47 +0000</pubDate>
      <link>https://dev.to/oderofrancis/mastering-python-the-right-way-3bcg</link>
      <guid>https://dev.to/oderofrancis/mastering-python-the-right-way-3bcg</guid>
      <description>&lt;p&gt;&lt;strong&gt;Python the right way?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I do get the confusion when you hear "Right Way", you seem to have been learning the wrong way 😅😅😅😅. Relax grab a chair and be comfortable because am going to take you to a tour on  advance level in python just an overview.&lt;/p&gt;

&lt;p&gt;Before we get deeper, check out the articles:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://dev.to/oderofrancis/introduction-to-modern-python-95n"&gt;Introduction to modern Python.&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/oderofrancis/the-django-way--215a"&gt;The Django way&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/oderofrancis/python-django-web-framework-3fh9"&gt;Python Django web framework.&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/oderofrancis/introduction-to-data-structures-and-algorithms-with-modern-python-5cg9"&gt;Introduction to data structures with Modern Python.&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

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

&lt;p&gt;I know you know about Python snake but here we are all about Python programming Language.&lt;br&gt;
Python is a computer programming language that is used to build websites and software, perform data analysis and automate tasks.&lt;/p&gt;

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

&lt;p&gt;Python is commonly used :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Web Development&lt;/li&gt;
&lt;li&gt;Artificial Intelligence(AI) &amp;amp; Machine Learning&lt;/li&gt;
&lt;li&gt;Data Science&lt;/li&gt;
&lt;li&gt;Game development&lt;/li&gt;
&lt;li&gt;Desktop GUI Development&lt;/li&gt;
&lt;li&gt;Automation or scripting&lt;/li&gt;
&lt;li&gt;Android applications&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;1. Web development.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Python is frequently used to create a website's or application's back end;the elements that the user doesn't see. Sending data to and from servers, processing data and interfacing with databases, URL routing, and ensuring security are all examples of Python's role in web development. Python has a number of web development frameworks. Django and Flask are two popular ones, there is APIs which is upcoming a greater speed.&lt;/p&gt;

&lt;p&gt;Back end engineers, full stack engineers, Python developers, software engineers, and DevOps engineers are some of the web development positions that require Python.&lt;/p&gt;

&lt;p&gt;Python web framework used:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Django.&lt;/li&gt;
&lt;li&gt;Flask.&lt;/li&gt;
&lt;li&gt;Python API.&lt;/li&gt;
&lt;li&gt;CherryPy.&lt;/li&gt;
&lt;li&gt;Pyramid.&lt;/li&gt;
&lt;li&gt;Bottle.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2.Artificial Intelligence(AI) &amp;amp; Machine Learning&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Artificial intelligence,refers to the ability of robots to demonstrate intellect as opposed to human intelligence.&lt;/p&gt;

&lt;p&gt;Python has a standard library in the development, as well as a few AI libraries. It offers a simple control flow and data structures, as well as a straightforward syntax. It also allows for interpretative run-time without the use of standard compiler languages.This makes Python especially useful for prototyping algorithms for AI.&lt;/p&gt;

&lt;p&gt;Machine Learning is making the computer learn from studying data and statistics. Machine Learning is a step into the direction of artificial intelligence.&lt;br&gt;
Python is used in machine language due to its simple syntax, the development of applications with Python is fast when compared to many programming languages. Furthermore, it allows the developer to test algorithms without implementing them. Readable code is also vital for collaborative coding. Many individuals can work together on a complex project.&lt;/p&gt;

&lt;p&gt;Python libraries used:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Numpy.&lt;/li&gt;
&lt;li&gt;Scipy.&lt;/li&gt;
&lt;li&gt;Scikit-learn.&lt;/li&gt;
&lt;li&gt;Theano.&lt;/li&gt;
&lt;li&gt;TensorFlow.&lt;/li&gt;
&lt;li&gt;Keras.&lt;/li&gt;
&lt;li&gt;PyTorch.&lt;/li&gt;
&lt;li&gt;Pandas.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3.Data Science.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Python has become a staple in data science, allowing data analysts and other professionals to use the language to conduct complex statistical calculations, create data visualizations, build machine learning algorithms, manipulate and analyze data, and complete other data-related tasks.&lt;/p&gt;

&lt;p&gt;Python can build a wide range of different data visualizations, like line and bar graphs, pie charts, histograms, and 3D plots. Python also has a number of libraries that enable coders to write programs for data analysis and machine learning more quickly and efficiently, like TensorFlow and Keras.&lt;/p&gt;

&lt;p&gt;Python modules used:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;TensorFlow.&lt;/li&gt;
&lt;li&gt;NumPy.&lt;/li&gt;
&lt;li&gt;SciPy.&lt;/li&gt;
&lt;li&gt;Pandas.&lt;/li&gt;
&lt;li&gt;Matplotlib.&lt;/li&gt;
&lt;li&gt;Keras.&lt;/li&gt;
&lt;li&gt;SciKit-Learn.&lt;/li&gt;
&lt;li&gt;PyTorch.&lt;/li&gt;
&lt;li&gt;seaborn.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. Game development&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Python provides a built-in library called pygame, which used to develop the game.We can utilize the pygame package to create games with appealing images, appropriate animation, and sound. Pygame is a cross-platform library that is used to design video games. Good examples are :&lt;br&gt;
 Battlefield 2 uses Python for all of its add-ons and a lot of its functionality. &lt;br&gt;
Disney's Toontown Online is written in Python and uses Panda3D for graphics. &lt;br&gt;
Eve Online uses Stackless Python. Mount &amp;amp; Blade is written in Python.&lt;br&gt;
The Temple of Elemental Evil, a computer role-playing game based on the classic Greyhawk Dungeons &amp;amp; Dragons campaign setting.&lt;br&gt;
Unity of Command (video game) is an operational-level wargame about the 1942–43 Stalingrad Campaign on the Eastern Front.&lt;/p&gt;

&lt;p&gt;Python libraries used:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pygame.&lt;/li&gt;
&lt;li&gt;PyKyra.&lt;/li&gt;
&lt;li&gt;Pyglet.&lt;/li&gt;
&lt;li&gt;PyOpenGL.&lt;/li&gt;
&lt;li&gt;Kivy.&lt;/li&gt;
&lt;li&gt;Panda3D.&lt;/li&gt;
&lt;li&gt;Cocos2d.&lt;/li&gt;
&lt;li&gt;Python-Ogre.&lt;/li&gt;
&lt;li&gt;Ren’Py.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5. Desktop GUI Development&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Python has been successful in a wide variety of use cases. But few understand and appreciate its abilities in creating graphical user interfaces (GUI.) Indeed we have a handful of extraordinary python GUI frameworks that helps developers quickly put up an interface to interact with their project.&lt;br&gt;
Think about TKinter which most know it but let's check other libraries used for GUI.&lt;/p&gt;

&lt;p&gt;Python libraries used:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tkinter.&lt;/li&gt;
&lt;li&gt;Plotly Dash.&lt;/li&gt;
&lt;li&gt;PyGUI.&lt;/li&gt;
&lt;li&gt;Kivy.&lt;/li&gt;
&lt;li&gt;Plotly Dash.&lt;/li&gt;
&lt;li&gt;PyQt5.&lt;/li&gt;
&lt;li&gt;WxPython.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;6. Automation or scripting.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you find yourself performing a task over and over again, you could work more efficiently by automating it with Python. Writing code used to build these automated processes is called scripting. In the coding world, automation can be used to check for errors across multiple files, convert files, execute simple math, and remove duplicates in data.&lt;br&gt;
Python can even be used by relative beginners to automate simple tasks on the computer;such as renaming files,calculating exchange rates,performing quick math equations,sending HTTP requests,converting image files, finding and downloading online content or sending emails or texts at desired intervals.&lt;/p&gt;

&lt;p&gt;Python libraries used:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Robot Framework.&lt;/li&gt;
&lt;li&gt;PyTest.&lt;/li&gt;
&lt;li&gt;Splinter.&lt;/li&gt;
&lt;li&gt;Selenium. &lt;/li&gt;
&lt;li&gt;Behave.&lt;/li&gt;
&lt;li&gt;Pywinauto.&lt;/li&gt;
&lt;li&gt;Automagica.&lt;/li&gt;
&lt;li&gt;Beautiful Soup.&lt;/li&gt;
&lt;li&gt;PDFMiner.&lt;/li&gt;
&lt;li&gt;Locust framework.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;7. Android applications&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;While it is possible to develop Android apps in Python, it will not be as effective or reliable as Android app development in Java. As we all know, Google declared Java to be the official language for Android. Java for Android is the de facto standard for Android, and other languages we utilize may not be up to snuff.Python has some concern in android development such as :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Other frameworks might not be able to support all of the features of the Android OS.&lt;/li&gt;
&lt;li&gt;It is not always possible to utilize one's own tools.&lt;/li&gt;
&lt;li&gt;These programs may not be very fast because they create native code first and then optimize it with native compilers.&lt;/li&gt;
&lt;li&gt;It is possible that high-level graphics will not be supported at all times.&lt;/li&gt;
&lt;li&gt;The program you'll create will operate flawlessly on your local desktop, but the animations won't be as smooth on Android. It's also slow because it's still running as a Python instance.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Python libraries used:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Kivy.&lt;/li&gt;
&lt;li&gt;Beeware.&lt;/li&gt;
&lt;li&gt;SL4A (Scripting Layer for Android).&lt;/li&gt;
&lt;li&gt;Pyqtdeploy.&lt;/li&gt;
&lt;li&gt;Chaquopy.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;I hope for know you know the area of interest you need to venture in. Remember never there is no python library that is better than the other only that the have different speciality.&lt;br&gt;
Ferrari is fast but can't carry bulk goods and a tractor can carry bulk goods but isn't fast.&lt;/p&gt;

&lt;p&gt;Be a problem solver.&lt;/p&gt;

&lt;p&gt;"If you can write "hello world" you can change the world" &lt;br&gt;
              - Raghu Venkatesh&lt;/p&gt;

</description>
      <category>python</category>
      <category>100daysofcode</category>
      <category>codenewbie</category>
      <category>git</category>
    </item>
    <item>
      <title>Web Scrapping With Python.</title>
      <dc:creator>FRANCIS ODERO</dc:creator>
      <pubDate>Sun, 27 Feb 2022 17:03:41 +0000</pubDate>
      <link>https://dev.to/oderofrancis/python-for-everyone-mastering-python-the-right-way-51pg</link>
      <guid>https://dev.to/oderofrancis/python-for-everyone-mastering-python-the-right-way-51pg</guid>
      <description>&lt;p&gt;Suppose you want some data of a product from a company? Let's say the price of all commodities to be in a comma separated value(CSV) or photos from a social media! what will you do?&lt;br&gt;
Actually, you can copy information from the respective site and paste it into your own file. But what if you want to get a huge amount of information from the site as soon as possible? Such as large amounts of data from a website to train a Machine Learning algorithm?&lt;br&gt;
In that case, copy and paste will not work! And then you will need to use Web Scraping.Web scraping uses intelligence automation methods to get thousands or even millions of data sets in a smaller amount of time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Web Scraping?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Web scraping is a means of extracting vast volumes of data from websites in an automated manner. The majority of this data is unstructured HTML data that is converted to structured data in a spreadsheet or database before being used in various applications. &lt;br&gt;
To gather data from websites, web scraping can be done in a variety of methods. These options include leveraging internet services, specific APIs, and even writing your own web scraping code from scratch. Many huge websites, such as Google, Twitter, Facebook, StackOverflow, and others, provide APIs that let you access their data in a structured fashion.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Application of web scrapping&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Market research&lt;/li&gt;
&lt;li&gt;Price monitoring&lt;/li&gt;
&lt;li&gt;News monitoring&lt;/li&gt;
&lt;li&gt;Email marketing&lt;/li&gt;
&lt;li&gt;Sentiment Analysis&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Python&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Why python🤔, since it is the most popular language for web scraping as it can handle most of the processes easily. It also has a variety of libraries that were created specifically for Web Scraping that is &lt;a href="https://pypi.org/project/Scrapy/" rel="noopener noreferrer"&gt;scrapy&lt;/a&gt; and &lt;a href="https://pypi.org/project/beautifulsoup4/" rel="noopener noreferrer"&gt;beautiful soup&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;So let's start 😀😀😀💪💪&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Installing of python.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Install python 3 and virtualenv then make virtual environment.&lt;/p&gt;

&lt;p&gt;Install python 3 first by running following line of code in terminal:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ sudo apt install python3&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then install virtual environment, in our terminal type in:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ sudo apt install python3-venv&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After installing python and virtualenv, create a folder and virtualenv then activate the created virtualenv.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create project folder:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;mkdir web_scrap&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;So lets go to the inside of web_scrap directory :&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cd web_scrap&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create virtualenv:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;virtualenv env&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;activate virtualenv:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;. env/bin/activate&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fc1qjhc57492rpyr8mew9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fc1qjhc57492rpyr8mew9.png" alt="Image description" width="727" height="325"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This are basic steps to setup our coding environment, check out &lt;a href="https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/" rel="noopener noreferrer"&gt;this&lt;/a&gt; for more.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Create python file.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Create a python file scrap.py and open it in &lt;a href="https://code.visualstudio.com" rel="noopener noreferrer"&gt;visual studio&lt;/a&gt; or on your favorite text editor.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F3hto1lze67bqprxu2hos.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F3hto1lze67bqprxu2hos.png" alt="Image description" width="727" height="120"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Import packages.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Download and import packages in the virtual environment.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pip install requests&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pip install bs4&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pip install termcolor&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The python modules that will be using:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;re - regular expression.&lt;/li&gt;
&lt;li&gt;requests- to scrap data directory from Instagram.&lt;/li&gt;
&lt;li&gt;beautifulSoup - to get specific filtered part from all data.&lt;/li&gt;
&lt;li&gt;urllib - to use request to download from url.&lt;/li&gt;
&lt;li&gt;os - to store downloaded file in our media folder.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fuhje5mxvqrtof3436oak.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fuhje5mxvqrtof3436oak.png" alt="Image description" width="696" height="262"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Get website link.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's add a simple input system to get any url as an input url:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;url = input("enter here your url from instagram")&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Get any url from Instagram then get data from the url using &lt;code&gt;requests&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;data = requests.get(url)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can print the data and check the results.&lt;/p&gt;

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

&lt;p&gt;The codes&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Flivaj4z8aey6sv4mvjjw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Flivaj4z8aey6sv4mvjjw.png" alt="Image description" width="800" height="117"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The outuput&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fiond3yuvipty0l5u0tbo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fiond3yuvipty0l5u0tbo.png" alt="Image description" width="726" height="114"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now let's take a case for a video.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;https://www.instagram.com/p/B_wH2aCnyEh/?utm_medium=copy_link&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This is the page with the video.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fhgnt463r7qgsbi8g5v3t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fhgnt463r7qgsbi8g5v3t.png" alt="Image description" width="800" height="491"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And here is the source code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fvb13xmrobea7uyqcnkw1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fvb13xmrobea7uyqcnkw1.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And In This Page If you just find(by ctrl + F) ‘mp4’ . Then You will find something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F09rw3swmxmvs8zyy38be.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F09rw3swmxmvs8zyy38be.png" alt="Image description" width="800" height="78"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The link that contain the mp4 is the main thing we need:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;"https://instagram.fnbo9-1.fna.fbcdn.net/v/t50.2886-16/95332972_323221645317471_817729865566514230_n.mp4?efg=eyJ2ZW5jb2RlX3RhZyI6InZ0c192b2RfdXJsZ2VuLjQ4MC5mZWVkLmRlZmF1bHQiLCJxZV9ncm91cHMiOiJbXCJpZ193ZWJfZGVsaXZlcnlfdnRzX290ZlwiXSJ9\u0026_nc_ht=instagram.fnbo9-1.fna.fbcdn.net\u0026_nc_cat=103\u0026_nc_ohc=Q1fkDGBA2oEAX9xsGin\u0026edm=AABBvjUBAAAA\u0026vs=18035297806253182_2714272676\u0026_nc_vs=HBksFQAYJEdHeXFyZ1ZmVlZybjl5VUJBRGJzVWUtNktGa0xia1lMQUFBRhUAAsgBABUAGCRHSFlhdkFWNG9oRUFsSEFHQVAwaFlDdDdtOVl0YmtZTEFBQUYVAgLIAQAoABgAGwGIB3VzZV9vaWwBMBUAACb8yIvTv8CJQBUCKAJDMywXQCbul41P3zsYEmRhc2hfYmFzZWxpbmVfMV92MREAdeoHAA%3D%3D\u0026ccb=7-4\u0026oe=621DCC10\u0026oh=00_AT_7jbU74b8Fm9-U5y6GQhURJihmzKNI_AEvVNjI4e-Blw\u0026_nc_sid=83d603"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Due to Instagram terms instead use the below link for video:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;https://www.w3schools.com/html/movie.mp4&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;match = re.findall(r’url\W\W\W([-\W\w]+)\W\W\Wvideo_view_count’, str)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;What the code above does is to find the url above whenever we run the code.&lt;/p&gt;

&lt;p&gt;To extract the video we have to declare a variable name extraction and inside this variable we will store the file format for video, as shown below.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;extraction = “.mp4”&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Also do the same for image but use &lt;code&gt;profile_pic_url&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;"https://instagram.fnbo9-1.fna.fbcdn.net/v/t51.2885-19/274607143_1204294113308064_418123174948225933_n.jpg?stp=dst-jpg_s150x150\u0026_nc_ht=instagram.fnbo9-1.fna.fbcdn.net\u0026_nc_cat=100\u0026_nc_ohc=L3oR46dvCW0AX-fS68k\u0026edm=AABBvjUBAAAA\u0026ccb=7-4\u0026oh=00_AT_7whkb_tXXNikAlnrI8yBifCb9zDwZK0Zt5q462q93Vw\u0026oe=6222855B\u0026_nc_sid=83d603"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;as shown below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fmbtdemuodr515z2nb12m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fmbtdemuodr515z2nb12m.png" alt="Image description" width="800" height="580"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;source code :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fg8uyynaxdkm9xou9l5tc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fg8uyynaxdkm9xou9l5tc.png" alt="Image description" width="800" height="404"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;search &lt;code&gt;profile_pic_url&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F8mh6w8leahon0wnh7vvk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F8mh6w8leahon0wnh7vvk.png" alt="Image description" width="613" height="66"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For image link use:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;https://www.w3schools.com/html/pic_trulli.jpg&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;match = re.findall(r'profile_pic_url\W\W\W([\W\w]+)\W\W\Wdisplay_resources’, str)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And Now Our extraction variable value is :&lt;/p&gt;

&lt;p&gt;&lt;code&gt;extraction = “.jpg”&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;So last line of this step is to collect the actual post video or image’s url in a variable as a regular exp. array to string. To do that :&lt;/p&gt;

&lt;p&gt;&lt;code&gt;res = match[0]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Data extraction.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here we have to download and get the caption of the post.&lt;/p&gt;

&lt;p&gt;We will use BeautifulSoup in our code to get the caption or title of the post.We have to assign all data (str) to pass through BS4 and filter it .&lt;/p&gt;

&lt;p&gt;&lt;code&gt;page = BeautifulSoup(str, "html.parser")&lt;br&gt;
title = page.find("title")&lt;br&gt;
title = title.get_text()&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;So the code will find the title of this page and store the title varible.&lt;br&gt;
After this we have to perform regular expression to make our file name saved and also store in a media folder.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;title = re.sub(r"\W+", "_", title)&lt;br&gt;
title = "download/web_scrap"+title+"web_scrap"&lt;br&gt;
print("\n"+title)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;We use &lt;code&gt;download/&lt;/code&gt; because we want to store our downloaded file in a new folder called &lt;code&gt;download/&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if res != "" :
print('found \n \n'+'\033[1m'+colored(res, 'green')+'\033[0m'+'\n') #'found word:cat'
 download = input("Do you want to download(y/N) : ")
if (download == "y" or download == "Y"):
  try:
   fileName = title
   print("Downloading.....")
   DFU.urlretrieve(res, fileName+extraction)
   print("Download Successfully!")
   os.system("tree download")
except:
   print("Sorry! Download Unsuccessful")
else:
 print('did not find or post is from private account')
 exit()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So if &lt;code&gt;res&lt;/code&gt; variable is not empty then print the actual link of post.Then make a input and this input will ask you that you want to download this file or not.To do so, answer with y or n .If answer is Y or y then it will continue working. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;if (download == “y”):&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;That's all on how to download an image and a video from a social media Instagram.&lt;/p&gt;

&lt;p&gt;Get the source code &lt;a href="https://github.com/oderofrancis/web_scrap" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;THank you for taking your time to go through this article.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;KEEP MOVING ON 💪💪💪💪💪💪&lt;/strong&gt;
&lt;/h3&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;HAPPY CODING&lt;/strong&gt;
&lt;/h3&gt;

</description>
      <category>python</category>
      <category>webscrapping</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>Python Program to Check Leap Year</title>
      <dc:creator>FRANCIS ODERO</dc:creator>
      <pubDate>Mon, 21 Feb 2022 14:33:15 +0000</pubDate>
      <link>https://dev.to/oderofrancis/python-program-to-check-leap-year-6fb</link>
      <guid>https://dev.to/oderofrancis/python-program-to-check-leap-year-6fb</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Sometimes it is hard to tell if a year is a leap year or not, especially the years back in 1900-1999 right!&lt;/p&gt;

&lt;p&gt;Have you ever thought how to check if a year is a leap year using Python?&lt;/p&gt;

&lt;p&gt;Before we get our hands on coding check out &lt;a href="https://dev.to/oderofrancis/introduction-to-modern-python-95n"&gt;this article&lt;/a&gt; to get more basic information on Python.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let's dive in coding&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We shall create a program to check leap year&lt;br&gt;
There are two ways:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;using calender module.&lt;/li&gt;
&lt;li&gt;Using operators.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;1. Using calender module&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For this is the simplest as one just have to import calender and use &lt;code&gt;calender.isleap()&lt;/code&gt; as shown below :&lt;br&gt;
&lt;/p&gt;

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

year = int(input("Enter the year : "))

print(calendar.isleap(year))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The year entered is translated to True or False if the year is leap year or not respectively.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Using operators&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This method we have to define our procedure on how to check whether a year is a leap or not.&lt;br&gt;
First we have to get year from the user . Divide by 100 which means century year and divide also divide by 400.&lt;br&gt;
if not divided by 100 means not a century year but year divided by 4 is a leap year.&lt;br&gt;
A leap year is exactly divisible by 4 except for century years (years ending with 00). The century year is a leap year only if it is perfectly divisible by 400.&lt;/p&gt;

&lt;p&gt;As shown below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fpouwldi4g42fu1w9r57z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fpouwldi4g42fu1w9r57z.png" alt="Image description" width="714" height="298"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some of the output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Enter a year : 2030
2030 is not a leap year

Enter a year : 2000
2000 is a leap year

Enter a year : 1900
1900 is not a leap year

Enter a year : 1904
1904 is a leap year
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you know on how to check if a year is a leap year using two ways. Thank you for reading this article.&lt;/p&gt;

&lt;p&gt;KEEP ON MOVING 👣👣👣👣&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>calender</category>
    </item>
    <item>
      <title>Introduction to Data Structures and Algorithms With Modern Python</title>
      <dc:creator>FRANCIS ODERO</dc:creator>
      <pubDate>Mon, 21 Feb 2022 13:13:01 +0000</pubDate>
      <link>https://dev.to/oderofrancis/introduction-to-data-structures-and-algorithms-with-modern-python-5cg9</link>
      <guid>https://dev.to/oderofrancis/introduction-to-data-structures-and-algorithms-with-modern-python-5cg9</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Data is a common word we all hear from day to day. What is data 🤔. Data are facts and statistics that are collected together for reference or analysis to obtain trends and information.&lt;br&gt;
What about structure?&lt;br&gt;
Structure is the arrangement of and relations between the parts or elements of something complex.&lt;/p&gt;

&lt;p&gt;Now we have an insight of data and structure what about data structure? &lt;br&gt;
Data structure is a collection of data values, the relationships among them, and the functions or operations that can be applied to the data.The data structure organization,management and storage data format enables efficient access, store collections of data, relate them, perform operations on them accordingly and modification. &lt;/p&gt;

&lt;p&gt;Data structures are generally based on the ability of a computer to fetch and store data at any place in its memory, specified by a pointer a bit string, representing a memory address, that can be itself stored in memory and manipulated by the program.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What you need for this article&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://dev.to/oderofrancis/introduction-to-modern-python-95n"&gt;Introduction to modern python&lt;/a&gt; in order to get the syntax on how to code in Python.&lt;/li&gt;
&lt;li&gt;Have a positive mind that coding is manageable.&lt;/li&gt;
&lt;li&gt;Keep moving on 💪&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Let's get to know more about data structures.&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Data structures serve as the basis for abstract data types (ADT). The ADT defines the logical form of the data type. The data structure implements the physical form of the data type.&lt;/p&gt;

&lt;p&gt;Different data structures are better suited to different applications, and some are highly specialized to certain tasks. For example, B-tree indexes are extensively used in relational databases for data retrieval, while hash tables are commonly used in compiler implementations to seek up identifiers.&lt;br&gt;
For applications such as big databases and internet indexing services, data structures provide a way to efficiently manage massive amounts of data. In most cases, building efficient algorithms necessitates the use of efficient data structures.&lt;br&gt;
Some formal design methods and programming languages emphasize data structures, rather than algorithms, as the key organizing factor in software design. Data structures can be used to organize the storage and retrieval of information stored in both main memory and secondary memory.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Types of Data Structures in Python&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Python has implicit(built-in) support for Data Structures which enable you to store and access data. These structures are called List, Dictionary, Tuple and Set.&lt;br&gt;
There are user-defined data structures that allow user to full control on their functionality.These structures are called queues,stack and linked lists.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Flyc0axr9bek8v1s0m9td.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Flyc0axr9bek8v1s0m9td.jpg" alt="Image description" width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;1. List&lt;/strong&gt;&lt;br&gt;
Python Lists are just like the arrays, declared in other languages which is an ordered collection of data. They are  very flexible as the items in a list they aren't supposed to be of the same type.&lt;br&gt;
To create a list, you use the square brackets and add elements into it accordingly. If you do not pass any elements inside the square brackets, you get an empty list as the output.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fx8owpjpmm3krkl227tsd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fx8owpjpmm3krkl227tsd.png" alt="Image description" width="767" height="194"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Adding Elements&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Adding the elements in the list can be achieved using the append(), extend() and insert() functions.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;append()&lt;/code&gt; function adds all the elements passed to it as a single element.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;extend()&lt;/code&gt; function adds the elements one-by-one into the list.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;insert()&lt;/code&gt; function adds the element passed to the index value and increase the size of the list too.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F2mnrwg199cd96m1lj4pz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F2mnrwg199cd96m1lj4pz.png" alt="Image description" width="763" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deleting Elements&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To delete elements, use the &lt;code&gt;del&lt;/code&gt; keyword which is built-in into Python but this does not return anything back to us.&lt;/li&gt;
&lt;li&gt;If you want the element back, you use the &lt;code&gt;pop()&lt;/code&gt; function which takes the index value.&lt;/li&gt;
&lt;li&gt;To remove an element by its value, you use the &lt;code&gt;remove()&lt;/code&gt; function.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F67z9107ihngaoe5idopi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F67z9107ihngaoe5idopi.png" alt="Image description" width="758" height="308"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Accessing Elements&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Accessing elements is the same as accessing Strings in Python. You pass the index values and hence can obtain the values as needed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fp5siap724bru29ozlu61.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fp5siap724bru29ozlu61.png" alt="Image description" width="743" height="472"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Other Functions&lt;/strong&gt;&lt;br&gt;
You have several other functions that can be used when working with lists.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;len()&lt;/code&gt; function returns to us the length of the list.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;index()&lt;/code&gt; function finds the index value of value passed where it has been encountered the first time.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;count()&lt;/code&gt; function finds the count of the value passed to it.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;sorted()&lt;/code&gt; and &lt;code&gt;sort()&lt;/code&gt; functions do the same thing, that is to sort the values of the list. The &lt;code&gt;sorted()&lt;/code&gt; has a return type whereas the &lt;code&gt;sort()&lt;/code&gt; modifies the original list.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fbs181q2zeef85kbk5jeh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fbs181q2zeef85kbk5jeh.png" alt="Image description" width="756" height="319"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Dictionaries&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Dictionaries are used to store data values in key:value pairs.They can be ordered, means that the items have a defined order, and that order will not change.They can also be unordered where the items does not have a defined order, you cannot refer to an item by using an index.Dictionaries are changeable, meaning that we can change, add or remove items after the dictionary has been created.Dictionaries cannot have two items with the same key&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creating a Dictionary&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Dictionaries can be created using the flower braces or using the &lt;code&gt;dict()&lt;/code&gt; function. You need to add the key-value pairs whenever you work with dictionaries.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fhhnfhnuon3hpnt4qaklg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fhhnfhnuon3hpnt4qaklg.png" alt="Image description" width="764" height="284"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Changing and Adding key, value pairs&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To change the values of the dictionary, you need to do that using the keys. So, you firstly access the key and then change the value accordingly. To add values, you simply just add another key-value pair as shown below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fj8e6xdcojh7wzb1zu63b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fj8e6xdcojh7wzb1zu63b.png" alt="Image description" width="757" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Accessing Elements&lt;/strong&gt;&lt;br&gt;
You can access elements using the keys only. You can use either the &lt;code&gt;get()&lt;/code&gt; function or just pass the key values and you will be retrieving the values.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fucfzq6hsrhrxhr4yd095.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fucfzq6hsrhrxhr4yd095.png" alt="Image description" width="766" height="253"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Other Functions&lt;/strong&gt;&lt;br&gt;
You have different functions which return to us the keys or the values of the key-value pair accordingly to the &lt;code&gt;keys()&lt;/code&gt;, &lt;code&gt;values()&lt;/code&gt;, &lt;code&gt;items()&lt;/code&gt; functions accordingly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fjs6z1qt7ci68mnh1uiuv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fjs6z1qt7ci68mnh1uiuv.png" alt="Image description" width="761" height="341"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Tuple&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Tuples are used to store multiple items in a single variable and is a collection which is ordered, unchangeable, and allow duplicate values.They are written with round brackets.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creating a Tuple&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You create a tuple using parenthesis or using the &lt;code&gt;tuple()&lt;/code&gt; function.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fgmxzaqb4nfdzusbhh5od.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fgmxzaqb4nfdzusbhh5od.png" alt="Image description" width="767" height="125"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Accessing Elements&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Accessing elements is the same as it is for accessing values in lists.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Frrddtsscutgar540xok1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Frrddtsscutgar540xok1.png" alt="Image description" width="772" height="424"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Appending Elements&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To append the values, you use the &lt;code&gt;+&lt;/code&gt; operator which will take another tuple to be appended to it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F00odtm0cbbntsfod7bml.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F00odtm0cbbntsfod7bml.png" alt="Image description" width="764" height="153"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Other Functions&lt;/strong&gt;&lt;br&gt;
These functions are the same as they are for lists.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fqaa7plthjx3sw5sntvxw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fqaa7plthjx3sw5sntvxw.png" alt="Image description" width="765" height="227"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;A set is a collection which is unordered, unchangeable, unindexed and do not allow duplicate values.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creating a set&lt;/strong&gt;&lt;br&gt;
Sets are created using the flower braces but instead of adding key-value pairs, you just pass values to it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F7fq8maezh1tmodbzjnz9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F7fq8maezh1tmodbzjnz9.png" alt="Image description" width="768" height="149"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Adding elements&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To add elements, you use the &lt;code&gt;add()&lt;/code&gt; function and pass the value to it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fdua80v0t1ya7jkp2cspc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fdua80v0t1ya7jkp2cspc.png" alt="Image description" width="763" height="159"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Remove element&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To remove an item in a set, use the &lt;code&gt;remove()&lt;/code&gt;, or the &lt;code&gt;discard()&lt;/code&gt; method.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F9642ec6cbp98gs5zws6r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F9642ec6cbp98gs5zws6r.png" alt="Image description" width="758" height="199"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Other functions&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;clear()&lt;/code&gt; method empties the set.&lt;/li&gt;
&lt;li&gt;The del keyword will delete the set completely.&lt;/li&gt;
&lt;li&gt;You can loop through the set items by using a for loop:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my_set = {"apple", "banana", "cherry"}

for x in my_set:
  print(x)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now that you have understood the built-in Data Structures, let’s get started with the user-defined Data Structures. &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;User-Defined Data Structures&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;User-defined Data Structures, the name itself suggests that users define how the Data Structure would work and define functions in it. This gives the user whole control over how the data needs to be saved, manipulated and so forth.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Queue&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A queue is a linear data structure which is based on the principle of First-In-First-Out (FIFO) where the data entered first will be accessed first. It is built using the array structure and has operations which can be performed from both ends of the Queue, that is, head-tail or front-back. Operations such as adding and deleting elements are called En-Queue and De-Queue and accessing the elements can be performed. Queues are used as Network Buffers for traffic congestion management, used in Operating Systems for Job Scheduling and many more.&lt;/p&gt;

&lt;p&gt;Operations associated with queue are: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Enqueue&lt;/strong&gt;: Adds an item to the queue. If the queue is full, then it is said to be an Overflow condition – Time Complexity : O(1)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dequeue&lt;/strong&gt;: Removes an item from the queue. The items are popped in the same order in which they are pushed. If the queue is empty, then it is said to be an Underflow condition – Time Complexity : O(1)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Front&lt;/strong&gt;: Get the front item from queue – Time Complexity : O(1)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rear&lt;/strong&gt;: Get the last item from queue – Time Complexity : O(1)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Implementation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. list&lt;/strong&gt;&lt;br&gt;
List is a Python’s built-in data structure that can be used as a queue.However, lists are quite slow for this purpose because inserting or deleting an element at the beginning requires shifting all of the other elements by one, requiring O(n) time as compare to &lt;code&gt;queue()&lt;/code&gt;,&lt;code&gt;deque()&lt;/code&gt;.Instead of &lt;code&gt;enqueue()&lt;/code&gt; and &lt;code&gt;dequeue()&lt;/code&gt;, &lt;code&gt;append()&lt;/code&gt; and &lt;code&gt;pop()&lt;/code&gt; function is used.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Ff01s6behhv6gbwjrm67z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Ff01s6behhv6gbwjrm67z.png" alt="Image description" width="765" height="647"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.  collections.deque&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Queue in Python can be implemented using deque class from the collections module. Deque is preferred over list in the cases where we need quicker append and pop operations from both the ends of container, as deque provides an O(1) time complexity for append and pop operations as compared to list which provides O(n) time complexity. Instead of &lt;code&gt;enqueue()&lt;/code&gt; and &lt;code&gt;deque()&lt;/code&gt;, &lt;code&gt;append()&lt;/code&gt; and &lt;code&gt;popleft()&lt;/code&gt; functions are used.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fymspgj1vqdj8vimnrht1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fymspgj1vqdj8vimnrht1.png" alt="Image description" width="765" height="671"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. queue.Queue&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Queue is built-in module of Python which is used to implement a queue. &lt;code&gt;queue.Queue(maxsize)&lt;/code&gt; initializes a variable to a maximum size of maxsize. A maxsize of zero ‘0’ means a infinite queue. This Queue follows FIFO rule. &lt;/p&gt;

&lt;p&gt;There are various functions available in this module:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;maxsize&lt;/code&gt; – Number of items allowed in the queue.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;empty()&lt;/code&gt; – Return True if the queue is empty, False otherwise.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;full()&lt;/code&gt; – Return True if there are maxsize items in the queue. If the queue was initialized with maxsize=0 (the default), then full() never returns True.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;get()&lt;/code&gt; – Remove and return an item from the queue. If queue is empty, wait until an item is available.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;get_nowait()&lt;/code&gt; – Return an item if one is immediately available, else raise QueueEmpty.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;put(item)&lt;/code&gt; – Put an item into the queue. If the queue is full, wait until a free slot is available before adding the item.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;put_nowait(item)&lt;/code&gt; – Put an item into the queue without blocking. If no free slot is immediately available, raise QueueFull.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;qsize()&lt;/code&gt; – Return the number of items in the queue.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F9y3hmc3xghi1h57oy5j6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F9y3hmc3xghi1h57oy5j6.png" alt="Image description" width="753" height="633"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;output &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fprrv9lw0n2utc9llt9dd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fprrv9lw0n2utc9llt9dd.png" alt="Image description" width="756" height="301"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Stack&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Stacks are linear Data Structures which are based on the principle of Last-In-First-Out (LIFO) where data which is entered last will be the first to get accessed. It is built using the array structure and has operations namely, pushing (adding) elements, popping (deleting) elements and accessing elements only from one point in the stack called as the TOP. This TOP is the pointer to the current position of the stack. Stacks are prominently used in applications such as Recursive Programming, reversing words, undo mechanisms in word editors and so forth.&lt;/p&gt;

&lt;p&gt;The functions associated with stack are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;empty()&lt;/code&gt; – Returns whether the stack is empty – Time Complexity: O(1)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;size()&lt;/code&gt; – Returns the size of the stack – Time Complexity: O(1)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;top()&lt;/code&gt; – Returns a reference to the topmost element of the stack – Time Complexity: O(1)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;push(a)&lt;/code&gt; – Inserts the element ‘a’ at the top of the stack – &lt;code&gt;Time Complexity&lt;/code&gt;: O(1)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;pop()&lt;/code&gt; – Deletes the topmost element of the stack – Time Complexity: O(1)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Implementation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Python’s built-in data structure list can be used as a stack. Instead of push(), append() is used to add elements to the top of the stack while pop() removes the element in LIFO order. &lt;br&gt;
Unfortunately, the list has a few shortcomings. The biggest issue is that it can run into speed issues as it grows. The items in the list are stored next to each other in memory, if the stack grows bigger than the block of memory that currently holds it, then Python needs to do some memory allocations. This can lead to some append() calls taking much longer than other ones.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F5ms19to9130yg3ipvqez.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F5ms19to9130yg3ipvqez.png" alt="Image description" width="755" height="674"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Linked list&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Linked lists are linear Data Structures which are not stored consequently but are linked with each other using pointers. The node of a linked list is composed of data and a pointer called next. These structures are most widely used in image viewing applications, music player applications and so forth.&lt;/p&gt;

&lt;p&gt;When to use deque() as a linked list?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Inserting and deleting elements at front and back respectively is the only need. Inserting and removing elements from the middle becomes time-consuming.&lt;/li&gt;
&lt;li&gt;In-place reversal since Python now allows elements to be reversed in the place itself.&lt;/li&gt;
&lt;li&gt;Storage is preferred over performance and not all elements get a separate node of their own.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Below is the implementation of the linked list:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F5qpblc2al47nlnw0kkrb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F5qpblc2al47nlnw0kkrb.png" alt="Image description" width="713" height="621"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://media2.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%2Frnffmof0lgw0pdpyite8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Frnffmof0lgw0pdpyite8.png" alt="Image description" width="721" height="184"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;That was a great moment getting to know more about data structures in modern python. Hope you had a great time through the article. Thank you for taking the time to read this.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;KEEP ON MOVING&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>datascience</category>
      <category>programming</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Python Django Web Framework</title>
      <dc:creator>FRANCIS ODERO</dc:creator>
      <pubDate>Sat, 12 Feb 2022 15:41:53 +0000</pubDate>
      <link>https://dev.to/oderofrancis/python-django-web-framework-3fh9</link>
      <guid>https://dev.to/oderofrancis/python-django-web-framework-3fh9</guid>
      <description>&lt;h3&gt;
  
  
  &lt;strong&gt;What is Django?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.djangoproject.com" rel="noopener noreferrer"&gt;Django&lt;/a&gt; is a high-level Python web framework that encourages rapid development and clean, pragmatic design.Django was designed to help developers take applications from concept to completion as quickly as possible, takes security seriously and helps developers avoid many common security mistakes and exceedingly scalable.&lt;br&gt;
Some well known sites that use Django include PBS, Instagram, Disqus, Washington Times, Bitbucket, YouTube, Gmail and Mozilla.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;Getting Started with Django&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Django use Model View Template which follows the Model View Controller pattern. The Model helps to handle database.The Template is a presentation layer which handles User Interface part completely. The View is used to execute the business logic and interact with a model to carry data and renders a template.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fy0b4ltatezj3ww12wvtf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fy0b4ltatezj3ww12wvtf.png" alt="Image description" width="571" height="261"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Requirements for this Tutorial&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Have Python installed: Install &lt;a href="https://www.python.org" rel="noopener noreferrer"&gt;Python&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Have a code editor installed: &lt;a href="https://code.visualstudio.com" rel="noopener noreferrer"&gt;I use Visual Studio Code&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's create a directory for a clean and well structured arrangement.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Then &lt;code&gt;cd&lt;/code&gt; into the project with: &lt;code&gt;cd webapp&lt;/code&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Set Up Your Virtual Environment&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Next thing we need to do, is set up our virtual environment, a virtual environment helps you run several versions of python/django right on your machine.AS you could have two different python/django projects running on different django versions without clashing.&lt;/p&gt;

&lt;p&gt;To set up our virtual environment, we’ll be using python’s package manager &lt;code&gt;pip&lt;/code&gt; to do the installation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ pip install virtualenv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After installation,it’s time to create a virtual environment that would enable us use a preferred django version of our choice.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Let's now open our VS code by:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;code .&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Activating Virtual Environment in VS code click on terminal at the top navigation section then select new terminal &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fietxf9m6kom02dgrv19n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fietxf9m6kom02dgrv19n.png" alt="Image description" width="800" height="56"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Install Django version 3.2 in the terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ pip install django==3.2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fs095ithqeep0azk1d8oc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fs095ithqeep0azk1d8oc.png" alt="Image description" width="800" height="185"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Starting a project&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;At the moment we have django in our virtual environment, it's time to start up our first project.In our terminal type in:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;django-admin.py startproject web .&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;this creates a folder &lt;code&gt;web&lt;/code&gt; and &lt;code&gt;manage.py&lt;/code&gt; in our webapp directory .&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fzghma1xurktwtuxnkwma.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fzghma1xurktwtuxnkwma.png" alt="Image description" width="307" height="251"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Django gives us files that makes our work easily.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The &lt;code&gt;__init__.py&lt;/code&gt; file - makes Python treat directories containing it as modules.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;asgi.py&lt;/code&gt; file - ASGI (Asynchronous Server Gateway Interface) provides an interface between async Python web servers and applications while it supports all the features provided by WSGI&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;settings.py&lt;/code&gt; file - is a core file in Django projects. It holds all the configuration values that your web app needs to work; database settings and a bunch other stuff.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;urls.py&lt;/code&gt; - this file returns an element for inclusion in urlpatterns.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;wsgi.py&lt;/code&gt;- this file is Django's primary deployment platform platform.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;manage.py&lt;/code&gt; - thii file is a command-line utility that works similar to the django-admin command.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Make migrations to our database&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Migrations helps us make changes to our database schema without losing any data, each time we create a new model or make changes to a current one and run migrations, it helps update our database tables with the schemas without having to go through all the stress of dragging and recreating the database ourselves.&lt;/p&gt;

&lt;p&gt;To make migrations to database type in:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python manage.py migrate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This outputs the following:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fcx9gvr2ebivynqqrr9r4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fcx9gvr2ebivynqqrr9r4.png" alt="Image description" width="800" height="556"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is a proof that our migrations have been made to our database.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Running our server&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Fire up our server using the manage.py file in our project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python manage.py runserver
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This shows &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fptkagceokb0f0jw7m9g4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fptkagceokb0f0jw7m9g4.png" alt="Image description" width="800" height="279"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we have our server running on &lt;code&gt;http://127.0.0.1:8000/&lt;/code&gt;, on webpage this is what we get to show our first project is running.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fjhwj7692f62jpljq24xv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fjhwj7692f62jpljq24xv.png" alt="Image description" width="800" height="406"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create our first App in our project.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We will now create a app named &lt;code&gt;app&lt;/code&gt; .To create the app, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ python manage.py startapp app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will create another directory called &lt;code&gt;app&lt;/code&gt; with files.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://127.0.0.1:8000/" rel="noopener noreferrer"&gt;http://127.0.0.1:8000/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.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%2Fjbmu9aaer41kee0h6rgh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fjbmu9aaer41kee0h6rgh.png" alt="Image description" width="361" height="412"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;__init__.py&lt;/code&gt; tells Python to treat the directory as a Python package.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;admin.py&lt;/code&gt; contains settings for the Django admin pages.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;apps.py&lt;/code&gt; contains settings for the application configuration.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;models.py&lt;/code&gt; contains a series of classes that Django’s ORM converts to database tables.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;tests.py&lt;/code&gt; contains test classes.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;views.py&lt;/code&gt; contains functions and classes that handle what data is displayed in the HTML templates.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once the app is created, install it in our project in &lt;code&gt;webapp/web/settings.py&lt;/code&gt; add this line in &lt;code&gt;'app',&lt;/code&gt; INSTALLED_APPS:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fx30dmzlg3q0pqhbx0mwd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fx30dmzlg3q0pqhbx0mwd.png" alt="Image description" width="378" height="258"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This identifies the project that the app created exist.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Add super user *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;To add superuser in our django project run the following code in the terminal.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python manage.py createsuperuser
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Fill the username, email, and password&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fqm6985vm0scal5q32r4l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fqm6985vm0scal5q32r4l.png" alt="Image description" width="800" height="258"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Login to the our django admin with &lt;code&gt;http://127.0.0.1:8000/admin&lt;/code&gt; and make sure your server is running.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fi722m44z8aw0d3v9j6zc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fi722m44z8aw0d3v9j6zc.png" alt="Image description" width="415" height="317"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Admin page:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F54n5el0lc21hhhag1vhy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F54n5el0lc21hhhag1vhy.png" alt="Image description" width="800" height="230"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create our first template&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Create a directory named &lt;code&gt;templates&lt;/code&gt; in the app directory.&lt;br&gt;
&lt;code&gt;webapp/app/templates&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fkp40hmj76hressykwjlj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fkp40hmj76hressykwjlj.png" alt="Image description" width="359" height="406"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create a View&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Navigate to the &lt;code&gt;views.py&lt;/code&gt; in&lt;code&gt;webapp/app/views.py&lt;/code&gt; and create a view function.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F30gsgz44y1vja73q6itl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F30gsgz44y1vja73q6itl.png" alt="Image description" width="565" height="191"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have added a file home.html which we haven't created. To do so add a create a home.html file named in our template directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;touch app/home.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fvukroa88kfdxbxra15pc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fvukroa88kfdxbxra15pc.png" alt="Image description" width="708" height="470"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You’ve now created a function to handle your views and templates html file to display to the user.&lt;/p&gt;

&lt;p&gt;Create &lt;code&gt;Urls.py&lt;/code&gt; file in app directory to hook up our URLs to be able to navigate to the web page we just created.In &lt;code&gt;web/urls.py&lt;/code&gt; include a URL configuration for the &lt;code&gt;app&lt;/code&gt;. Inside the web/urls.py include the following lines:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;from django.urls import path, **include**&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;path('', include('app.urls')),&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F4tozpv3yldk90s0q7atd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F4tozpv3yldk90s0q7atd.png" alt="Image description" width="450" height="180"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This checks for the module urls.py in app. The module doesn't exist yet, so we need to create if :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;touch app/urls.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this module created we need to import the &lt;code&gt;path&lt;/code&gt; object and our &lt;code&gt;app/views.py&lt;/code&gt; module &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F21qg53gn3kwfjuada4x9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F21qg53gn3kwfjuada4x9.png" alt="Image description" width="551" height="204"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's add some lines of code in our &lt;code&gt;app/templates/home.html&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fs5h7tfv7kwcj1z2y36vm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fs5h7tfv7kwcj1z2y36vm.png" alt="Image description" width="562" height="117"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, when you restart the server and visit &lt;code&gt;http://127.0.0.1:8000&lt;/code&gt;, you should be able to see the HTML template you created.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Ftak5bhlliqrbmwc4hr33.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Ftak5bhlliqrbmwc4hr33.png" alt="Image description" width="800" height="125"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Add a link to admin page in the html page:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fryvmv434dib1rfuxd2aw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fryvmv434dib1rfuxd2aw.png" alt="Image description" width="541" height="175"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Webpage visualization&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fos7i7qahte57vca5261q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fos7i7qahte57vca5261q.png" alt="Image description" width="525" height="232"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Add Bootstrap to our App&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We will use bootstrap for styling to our project rather than going the CSS styling .To install bootstrap in your app , use the &lt;a href="https://getbootstrap.com/docs/4.1/getting-started/introduction/#quick-start" rel="noopener noreferrer"&gt;Bootstrap CDN&lt;/a&gt;. This is an easier way to install Bootstrap that involves just adding a few lines of to our &lt;code&gt;home.html&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fk2j09hr0qauxzm75mmge.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fk2j09hr0qauxzm75mmge.png" alt="Image description" width="800" height="461"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, when you visit&lt;code&gt;http://127.0.0.1:8000&lt;/code&gt;, you should see that the page has been formatted with slightly different styling.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fqq7eds2thn6ctb3jzmzu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fqq7eds2thn6ctb3jzmzu.png" alt="Image description" width="669" height="247"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this section we have created our first django App and able to see our web page. Check out the &lt;a href="https://github.com/oderofrancis/lux_django" rel="noopener noreferrer"&gt;source code &lt;br&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Thank you&lt;/strong&gt;
&lt;/h3&gt;

</description>
      <category>django</category>
      <category>python</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Introduction To Modern Python</title>
      <dc:creator>FRANCIS ODERO</dc:creator>
      <pubDate>Sat, 12 Feb 2022 11:52:49 +0000</pubDate>
      <link>https://dev.to/oderofrancis/introduction-to-modern-python-95n</link>
      <guid>https://dev.to/oderofrancis/introduction-to-modern-python-95n</guid>
      <description>&lt;p&gt;What comes to your mind when a word like python is mentioned ? Snakes right...&lt;/p&gt;

&lt;p&gt;For now let's talk about programming leave alone about the snakes.&lt;br&gt;
Did you know that Python language is the most growing programming language in the world of programming.Be it web development, gaming, software development, machine learning, data analysis, data science ,Artificial Intelligence and more trending and upcoming crazy stuff in the globe? &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let's dive in.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What is Python?&lt;br&gt;
Python is Python is a high-level, general-purpose programming language that is interpreted.&lt;br&gt;
It is considered as "battery included" language because of its comprehensive standard library.This helps in supporting many programming paradigms like structural,object-oriented and functional programming.&lt;/p&gt;

&lt;p&gt;Guido van Rossum started working on Python in the late 1980s as a replacement for the ABC programming language, and Python 0.9.0 was released in 1991.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advantages of Python.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Easy to read, learn and write.&lt;/li&gt;
&lt;li&gt;Highly productive due to its simplicity to help developers focus on solving world problems.&lt;/li&gt;
&lt;li&gt;An interpreted language which means that Python directly executes the code line by line.&lt;/li&gt;
&lt;li&gt;Has a vast libraries support of over 200,000 packages.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Disadvantages of Python&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Slow in speed since python execute line by line of code.&lt;/li&gt;
&lt;li&gt;Python programming language uses a large amount of memory.&lt;/li&gt;
&lt;li&gt;Weak in mobile computing.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Before we dive deep into the essentials, kindly make sure that you have installed and set up your &lt;a href="https://www.python.org" rel="noopener noreferrer"&gt;Python&lt;/a&gt;, &lt;a href="https://code.visualstudio.com" rel="noopener noreferrer"&gt;visual code editor&lt;/a&gt; and &lt;a href="https://www.anaconda.com/products/individual" rel="noopener noreferrer"&gt;jupyter notebook or anaconda&lt;/a&gt; are standby and ready.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Python Fundamentals.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Data types&lt;/li&gt;
&lt;li&gt;Compound data structures&lt;/li&gt;
&lt;li&gt;Conditional,loops and functions&lt;/li&gt;
&lt;li&gt;Object-oriented programming and external libraries&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Data types.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;int&lt;/code&gt; (Integer)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Just numbers without a decimal.&lt;br&gt;
&lt;a href="https://media2.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%2Fmfjhbbq7h4vp3llk7e2y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fmfjhbbq7h4vp3llk7e2y.png" alt="Image description" width="800" height="82"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;str&lt;/code&gt; (strings)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They represent text.&lt;br&gt;
&lt;a href="https://media2.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%2Fkpzew1eakmraokxini1m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fkpzew1eakmraokxini1m.png" alt="Image description" width="800" height="87"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;float&lt;/code&gt; (floating point numbers)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Numbers with decimal points.&lt;br&gt;
&lt;a href="https://media2.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%2Fu9j6txqdaq28dpbzg5og.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fu9j6txqdaq28dpbzg5og.png" alt="Image description" width="800" height="86"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;bool&lt;/code&gt;(booleans)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;True&lt;/code&gt; or &lt;code&gt;False&lt;/code&gt; values.&lt;br&gt;
&lt;a href="https://media2.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%2F51paaydv9x64wh7apdfl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F51paaydv9x64wh7apdfl.png" alt="Image description" width="800" height="89"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Compound data structures&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;List&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is a collection which is ordered, they are changeable, can be duplicated.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fvx057ol9r185xxxzctkf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fvx057ol9r185xxxzctkf.png" alt="Image description" width="800" height="80"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tuple&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A collection of ordered items but they are unchangeable. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fl7u5dhwj1c7jfjm3w73z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fl7u5dhwj1c7jfjm3w73z.png" alt="Image description" width="800" height="149"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dictionary&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A collection that is unordered, changeable and indexed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fc3k3kzel173ce7lbtvje.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fc3k3kzel173ce7lbtvje.png" alt="Image description" width="800" height="99"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Set&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This a collection of unordered, unindexed items but they are changeable and doesn't take duplicate values.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fgjyf7tiuerpcj4k36p71.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fgjyf7tiuerpcj4k36p71.png" alt="Image description" width="800" height="157"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conditional,loops and functions&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The if statement
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if BOOLEAN EXPRESSION:
     STATEMENTS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;an example&lt;br&gt;
&lt;/p&gt;

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

if amount == 400:
  print("The tax price is " (amount*(16/100))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The if else statement&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is frequently the case that you want one thing to happen when a condition it true, and something else to happen when it is false. For that we have the if else statement.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;food = 'spam'

if food == 'spam':
    print("Ummmm, my favourite!")
else:
    print("No, I won't have it. I want spam!")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Chained conditionals&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is when there are more than two possibilities, if choice one is not true or false select choice two if choice two is not select three.&lt;br&gt;
&lt;/p&gt;

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

if var1:
   print ("1 - Got a true expression value")
   print (var1)

else:
   print( "1 - Got a false expression value")
   print (var1)

var2 = 0

if var2:
   print ("2 - Got a true expression value")
   print( var2)

else:
   print ("2 - Got a false expression value")
   print (var2)

print ("Good bye!")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Nested conditionals&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A nested if statement is an if statement that is nested (meaning, inside) another if statement or if/else statement. Those statements test true/false conditions and then take an appropriate action).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if x &amp;lt; y:
    STATEMENTS_A
else:
    if x &amp;gt; y:
        STATEMENTS_B
    else:
        STATEMENTS_C
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Practical example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if 0 &amp;lt; x:            # assume x is an int here
    if x &amp;lt; 10:
        print("x is a positive single digit.")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The for loop&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The for loop processes each item in a sequence, so it is used with Python’s sequence data types - strings, lists, and tuples.&lt;br&gt;
Each item in turn is (re-)assigned to the loop variable, and the body of the loop is executed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for LOOP_VARIABLE in SEQUENCE:
    STATEMENTS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;practical example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for x in range(0, 3):
    print("We're on time %d" % (x))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x = 1
while True:
    print("To infinity and beyond! We're getting close, on %d now!" % (x))
    x += 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Functions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A function is a block of code that performs some operations on input data and gives you the desired output. &lt;/p&gt;

&lt;p&gt;Functions are used in working on big projects to make maintainance of the code to be easier and real task. If a code performs similar tasks many times, a convenient way to manage your code is by using functions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fr9gdvqfhasitohjapf38.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fr9gdvqfhasitohjapf38.png" alt="Image description" width="800" height="63"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Object-oriented programming and external libraries&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Objects are instance of a class and are defined as an encapsulation of variables (data) and functions into a single entity. They have access to the variables (attributes) and methods (functions) from classes.&lt;/p&gt;

&lt;p&gt;Here is how you define a class and an object of it:&lt;br&gt;
&lt;/p&gt;

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

    def __init__(self, height, width):
        self.height = height
        self.width = width

    def area(self):
        area = self.height * self.width
        return area

rect1 = Rectangle(12, 10)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The attributes and methods can be accessed using dot(.) operator.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;rectl.height&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;rectl.width&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;rectl.area()&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;External libraries/modules&lt;/p&gt;

&lt;p&gt;Python has vast modules that are defined classes,attributes and methods that we can use to accomplish multiple tasks. For example, the &lt;code&gt;math&lt;/code&gt; library has many mathematical functions that can be used to perform various calculations. &lt;code&gt;matplotlib&lt;/code&gt; used for plotting.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import math as m
print(type(m))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;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;&amp;lt;class 'module'&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;using matplotlib&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Ffki86f0g6qhklfvwrbm4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Ffki86f0g6qhklfvwrbm4.png" alt="Image description" width="800" height="271"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;That's all for today Happy coding!!&lt;/strong&gt;&lt;/p&gt;

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