<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title>Real Python</title>
  <link href="https://realpython.com/atom.xml" rel="self"/>
  <link href="https://realpython.com/"/>
  <updated>2020-04-14T14:00:00+00:00</updated>
  <id>https://realpython.com/</id>
  <author>
    <name>Real Python</name>
  </author>

  
    <entry>
      <title>Inheritance and Composition: A Python OOP Guide</title>
      <id>https://realpython.com/courses/inheritance-composition-python/</id>
      <link href="https://realpython.com/courses/inheritance-composition-python/"/>
      <updated>2020-04-14T14:00:00+00:00</updated>
      <summary>In this step-by-step course, you&#39;ll learn about inheritance and composition in Python. You&#39;ll improve your object-oriented programming (OOP) skills by understanding how to use inheritance and composition and how to leverage them in their design.</summary>
      <content type="html">
        &lt;p&gt;In this course, you&amp;rsquo;ll explore &lt;strong&gt;inheritance&lt;/strong&gt; and &lt;strong&gt;composition&lt;/strong&gt; in Python. &lt;a href=&quot;https://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming)&quot;&gt;Inheritance&lt;/a&gt; and &lt;a href=&quot;https://en.wikipedia.org/wiki/Object_composition&quot;&gt;composition&lt;/a&gt; are two important concepts in object oriented programming that model the relationship between two classes. They are the building blocks of &lt;a href=&quot;https://realpython.com/python3-object-oriented-programming/&quot;&gt;object oriented design&lt;/a&gt;, and they help programmers to write reusable code.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this course, you&amp;rsquo;ll know how to&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use inheritance in Python&lt;/li&gt;
&lt;li&gt;Model class hierarchies using inheritance&lt;/li&gt;
&lt;li&gt;Use multiple inheritance in Python and understand its drawbacks&lt;/li&gt;
&lt;li&gt;Use composition to create complex objects&lt;/li&gt;
&lt;li&gt;Reuse existing code by applying composition&lt;/li&gt;
&lt;li&gt;Change application behavior at run-time through composition&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Combining Data in Pandas With merge(), .join(), and concat()</title>
      <id>https://realpython.com/pandas-merge-join-and-concat/</id>
      <link href="https://realpython.com/pandas-merge-join-and-concat/"/>
      <updated>2020-04-13T14:00:00+00:00</updated>
      <summary>In this step-by-step tutorial, you&#39;ll learn three techniques for combining data in Pandas: merge(), .join(), and concat(). Combining Series and DataFrame objects in Pandas is a powerful way to gain new insights into your data.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Pandas’ &lt;code&gt;Series&lt;/code&gt; and &lt;code&gt;DataFrame&lt;/code&gt; objects are powerful tools for exploring and analyzing data. Part of their power comes from a multifaceted approach to combining separate datasets. With Pandas, you can &lt;strong&gt;merge&lt;/strong&gt;, &lt;strong&gt;join&lt;/strong&gt;, and &lt;strong&gt;concatenate&lt;/strong&gt; your datasets, allowing you to unify and better understand your data as you analyze it. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll learn how and when to combine your data in Pandas with:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;merge()&lt;/code&gt;&lt;/strong&gt; for combining data on common columns or indices&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;.join()&lt;/code&gt;&lt;/strong&gt; for combining data on a key column or an index&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;concat()&lt;/code&gt;&lt;/strong&gt; for combining DataFrames across rows or columns&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you have some experience using &lt;code&gt;DataFrame&lt;/code&gt; and &lt;code&gt;Series&lt;/code&gt; objects in Pandas and you’re ready to learn how to combine them, then this tutorial will help you do exactly that. If you want a quick refresher on DataFrames before proceeding, then &lt;a href=&quot;https://realpython.com/courses/pandas-dataframes-101/&quot;&gt;Pandas DataFrames 101&lt;/a&gt; will get you caught up in no time.&lt;/p&gt;
&lt;p&gt;You can follow along with the examples in this tutorial using the interactive Jupyter Notebook available at the link below: &lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Get the Jupyter Notebook:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/pandas-merge-join-concat/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-pandas-merge-join-concat&quot; data-focus=&quot;false&quot;&gt;Click here to get the Jupyter Notebook  you&#39;ll use&lt;/a&gt; to learn about Pandas merge(), .join(), and concat() in this tutorial.&lt;/p&gt;&lt;/div&gt;

&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; The techniques you’ll learn about below will generally work for both &lt;code&gt;DataFrame&lt;/code&gt; and &lt;code&gt;Series&lt;/code&gt; objects. But for simplicity and conciseness, the examples will use the term &lt;strong&gt;dataset&lt;/strong&gt; to refer to objects that can be either DataFrames or Series.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;pandas-merge-combining-data-on-common-columns-or-indices&quot;&gt;Pandas &lt;code&gt;merge()&lt;/code&gt;: Combining Data on Common Columns or Indices&lt;/h2&gt;
&lt;p&gt;The first technique you’ll learn is &lt;code&gt;merge()&lt;/code&gt;. You can use &lt;code&gt;merge()&lt;/code&gt; any time you want to do database-like join operations. It’s the most flexible of the three operations you’ll learn.&lt;/p&gt;
&lt;p&gt;When you want to combine data objects based on one or more keys in a similar way to a relational database, &lt;code&gt;merge()&lt;/code&gt; is the tool you need. More specifically, &lt;code&gt;merge()&lt;/code&gt; is most useful when you want to combine rows that share data. &lt;/p&gt;
&lt;p&gt;You can achieve both &lt;strong&gt;many-to-one&lt;/strong&gt; and &lt;strong&gt;many-to-many&lt;/strong&gt; joins with &lt;code&gt;merge()&lt;/code&gt;. In a many-to-one join, one of your datasets will have many rows in the merge column that repeat the same values (such as 1, 1, 3, 5, 5), while the merge column in the other dataset will not have repeat values (such as 1, 3, 5).&lt;/p&gt;
&lt;p&gt;As you might have guessed, in a many-to-many join, both of your merge columns will have repeat values. These merges are more complex and result in the &lt;a href=&quot;https://en.wikipedia.org/wiki/Cartesian_product&quot;&gt;Cartesian product&lt;/a&gt; of the joined rows. &lt;/p&gt;
&lt;p&gt;This means that, after the merge, you’ll have every combination of rows that share the same value in the key column. You’ll see this in action in the &lt;a href=&quot;#examples&quot;&gt;examples&lt;/a&gt; below.&lt;/p&gt;
&lt;p&gt;What makes &lt;code&gt;merge()&lt;/code&gt; so flexible is the sheer number of options for defining the behavior of your merge. While the list can seem daunting, with practice you’ll be able to expertly merge datasets of all kinds. &lt;/p&gt;
&lt;p&gt;When you use &lt;code&gt;merge()&lt;/code&gt;, you’ll provide two required arguments:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The &lt;code&gt;left&lt;/code&gt; DataFrame &lt;/li&gt;
&lt;li&gt;The &lt;code&gt;right&lt;/code&gt; DataFrame&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;After that, you can provide a number of optional arguments to define how your datasets are merged:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;how&lt;/code&gt;&lt;/strong&gt;: This defines what kind of merge to make. It defaults to &lt;code&gt;&#39;inner&#39;&lt;/code&gt;,  but other possible options include &lt;code&gt;&#39;outer&#39;&lt;/code&gt;, &lt;code&gt;&#39;left&#39;&lt;/code&gt;, and &lt;code&gt;&#39;right&#39;&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;on&lt;/code&gt;&lt;/strong&gt;: Use this to tell &lt;code&gt;merge()&lt;/code&gt; which columns or indices (also called &lt;strong&gt;key columns&lt;/strong&gt; or &lt;strong&gt;key indices&lt;/strong&gt;) you want to join on. This is optional. If it isn’t specified, and &lt;code&gt;left_index&lt;/code&gt; and &lt;code&gt;right_index&lt;/code&gt; (covered below) are &lt;code&gt;False&lt;/code&gt;, then columns from the two DataFrames that share names will be used as join keys. If you use &lt;code&gt;on&lt;/code&gt;, then the column or index you specify must be present in both objects.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;left_on&lt;/code&gt; and &lt;code&gt;right_on&lt;/code&gt;&lt;/strong&gt;: Use either of these to specify a column or index that is present only in the &lt;code&gt;left&lt;/code&gt; or &lt;code&gt;right&lt;/code&gt; objects that you are merging. Both default to &lt;code&gt;None&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;left_index&lt;/code&gt; and &lt;code&gt;right_index&lt;/code&gt;&lt;/strong&gt;: Set these to &lt;code&gt;True&lt;/code&gt; to use the index of the left or right objects to be merged. Both default to &lt;code&gt;False&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;suffixes&lt;/code&gt;&lt;/strong&gt;: This is a tuple of strings to append to identical column names that are not merge keys. This allows you to keep track of the origins of columns with the same name.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These are some of the most important parameters to pass to &lt;code&gt;merge()&lt;/code&gt;. For the full list, see the &lt;a href=&quot;https://pandas.pydata.org/pandas-docs/stable/user_guide/merging.html#database-style-dataframe-or-named-series-joining-merging&quot;&gt;Pandas documentation&lt;/a&gt;.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; In this tutorial, you’ll see that examples always specify which column(s) to join on with &lt;code&gt;on&lt;/code&gt;. This is the safest way to merge your data because you and anyone reading your code will know exactly what to expect when &lt;code&gt;merge()&lt;/code&gt; is called. If you do not specify the merge column(s) with &lt;code&gt;on&lt;/code&gt;, then Pandas will use any columns with the same name as the merge keys. &lt;/p&gt;
&lt;/div&gt;
&lt;h3 id=&quot;how-to-merge&quot;&gt;How to &lt;code&gt;merge()&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;Before getting into the details of how to use &lt;code&gt;merge()&lt;/code&gt;, you should first understand the various forms of joins: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;inner&lt;/code&gt; &lt;/li&gt;
&lt;li&gt;&lt;code&gt;outer&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;left&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;right&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Even though you’re learning about merging, you’ll see &lt;code&gt;inner&lt;/code&gt;, &lt;code&gt;outer&lt;/code&gt;, &lt;code&gt;left&lt;/code&gt;, and &lt;code&gt;right&lt;/code&gt; also referred to as join operations. For this tutorial, you can consider these terms equivalent.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;You’ll learn about these in detail below, but first take a look at this visual representation of the different joins:
&lt;figure class=&quot;figure mx-auto d-block&quot;&gt;&lt;a href=&quot;https://files.realpython.com/media/join_diagram.93e6ef63afbe.png&quot; target=&quot;_blank&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid mx-auto d-block &quot; src=&quot;https://files.realpython.com/media/join_diagram.93e6ef63afbe.png&quot; width=&quot;811&quot; height=&quot;571&quot; srcset=&quot;https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/join_diagram.93e6ef63afbe.png&amp;amp;w=202&amp;amp;sig=95bee2529ed07ba897da0deeeca76ac08fe54d92 202w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/join_diagram.93e6ef63afbe.png&amp;amp;w=405&amp;amp;sig=405714f3a1c44944eed5dcfbdfed200bec9d241e 405w, https://files.realpython.com/media/join_diagram.93e6ef63afbe.png 811w&quot; sizes=&quot;75vw&quot; alt=&quot;Venn Diagram of Join Operations&quot;&gt;&lt;/a&gt;&lt;figcaption class=&quot;figure-caption text-center&quot;&gt;Visual Representation of Join Types&lt;/figcaption&gt;&lt;/figure&gt;&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/pandas-merge-join-and-concat/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/pandas-merge-join-and-concat/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #4: Learning Python Through Errors</title>
      <id>https://realpython.com/podcasts/rpp/4/</id>
      <link href="https://realpython.com/podcasts/rpp/4/"/>
      <updated>2020-04-10T12:00:00+00:00</updated>
      <summary>This week Christopher interviews Martin Breuss, about a couple of the video training courses he&#39;s created for Real Python. They discuss his course on getting started with Django, and how to learn Python through errors, and how errors really are your friends.

Martin talks about his work with Coding Nomads, and teaching Python around the world. He also provides some tips on debugging and writing good questions. This episode was recorded at an earlier date, and because of recent events Martin came back to discuss a new #StayAtHome Mentorship Program he&#39;s working on. The program is meant not only for learners but also for those who want to try their hand at being a mentor. We also answer our first listener submitted question.</summary>
      <content type="html">
        &lt;p&gt;This week Christopher interviews Martin Breuss, about a couple of the video training courses he&#39;s created for Real Python. They discuss his course on getting started with Django, and how to learn Python through errors, and how errors really are your friends.

Martin talks about his work with Coding Nomads, and teaching Python around the world. He also provides some tips on debugging and writing good questions. This episode was recorded at an earlier date, and because of recent events Martin came back to discuss a new #StayAtHome Mentorship Program he&#39;s working on. The program is meant not only for learners but also for those who want to try their hand at being a mentor. We also answer our first listener submitted question.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>How to Provide Test Fixtures for Django Models in Pytest</title>
      <id>https://realpython.com/django-pytest-fixtures/</id>
      <link href="https://realpython.com/django-pytest-fixtures/"/>
      <updated>2020-04-08T14:00:00+00:00</updated>
      <summary>In this step-by-step tutorial, you&#39;ll learn how to use fixtures to simplify your testing in pytest. If you use Django, pytest fixtures can help you write tests that are painless to update and maintain even as you make changes to your models.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;If you’re working in Django, &lt;a href=&quot;https://pytest.org/en/latest/fixture.html&quot;&gt;&lt;code&gt;pytest&lt;/code&gt; fixtures&lt;/a&gt; can help you create tests for your models that are uncomplicated to maintain. Writing good tests is a crucial step in sustaining a successful app, and &lt;strong&gt;fixtures&lt;/strong&gt; are a key ingredient in making your test suite efficient and effective. Fixtures are little pieces of data that serve as the baseline for your tests. &lt;/p&gt;
&lt;p&gt;As your test scenarios change, it can be a pain to add, modify, and maintain your fixtures. But don’t worry. This tutorial will show you how to use &lt;a href=&quot;https://pytest-django.readthedocs.io/en/latest/&quot;&gt;the &lt;code&gt;pytest-django&lt;/code&gt; plugin&lt;/a&gt; to make writing new test cases and fixtures a breeze. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How to create and load &lt;strong&gt;test fixtures&lt;/strong&gt; in Django&lt;/li&gt;
&lt;li&gt;How to create and load &lt;strong&gt;&lt;code&gt;pytest&lt;/code&gt; fixtures for Django models&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to use &lt;strong&gt;factories&lt;/strong&gt; to create test fixtures for Django models in &lt;code&gt;pytest&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;How to create dependencies between test fixtures using the &lt;strong&gt;factory as fixture&lt;/strong&gt; pattern&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The concepts described in this tutorial are suited for any Python project using &lt;a href=&quot;https://docs.pytest.org/en/latest/&quot;&gt;&lt;code&gt;pytest&lt;/code&gt;&lt;/a&gt;. For convenience, the examples use the Django ORM, but the results can be reproduced in other types of ORMs and even in projects that don’t use an ORM or a database.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Free Bonus:&lt;/strong&gt; &lt;a href=&quot;#&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-django-resources-learing-guide&quot; data-focus=&quot;false&quot;&gt;Click here to get access to a free Django Learning Resources Guide (PDF)&lt;/a&gt; that shows you tips and tricks as well as common pitfalls to avoid when building Python + Django web applications.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;fixtures-in-django&quot;&gt;Fixtures in Django&lt;/h2&gt;
&lt;p&gt;To get started, you’re going to set up a fresh Django project. Throughout this tutorial, you’ll write some tests using the &lt;a href=&quot;https://docs.djangoproject.com/en/3.0/topics/auth/default/&quot;&gt;built-in authentication module&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&quot;setting-up-a-python-virtual-environment&quot;&gt;Setting Up a Python Virtual Environment&lt;/h3&gt;
&lt;p&gt;When you create a new project, it’s best to also create a virtual environment for it. A virtual environment allows you to isolate the project from other projects on your computer. This way, different projects can use different versions of Python, Django, or any other package without interfering with each other.&lt;/p&gt;
&lt;p&gt;Here’s how you can create your virtual environment in a new directory:&lt;/p&gt;
&lt;div class=&quot;highlight sh&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; mkdir django_fixtures
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; django_fixtures
&lt;span class=&quot;go&quot;&gt;django_fixtures $ python -m venv venv&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;For step-by-step instructions on how to create a virtual environment, check out &lt;a href=&quot;https://realpython.com/python-virtual-environments-a-primer/&quot;&gt;Python Virtual Environments: A Primer&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Running this command will create a new directory called &lt;code&gt;venv&lt;/code&gt;. This directory will store all the packages you install inside the virtual environment.&lt;/p&gt;
&lt;h3 id=&quot;setting-up-a-django-project&quot;&gt;Setting Up a Django Project&lt;/h3&gt;
&lt;p&gt;Now that you have a fresh virtual environment, it’s time to set up a Django project. In your terminal, activate the virtual environment and install Django:&lt;/p&gt;
&lt;div class=&quot;highlight sh&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;source&lt;/span&gt; venv/bin/activate
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; pip install django
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now that you have Django installed, you can create a new Django project called &lt;code&gt;django_fixtures&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight sh&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; django-admin startproject django_fixtures
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;After running this command, you’ll see that Django created new files and directories. For more about how to start a new Django project, check out &lt;a href=&quot;https://realpython.com/django-setup/&quot;&gt;Starting a Django Project&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To finish setting up your Django project, apply the &lt;strong&gt;migrations&lt;/strong&gt; for the built-in modules:&lt;/p&gt;
&lt;div class=&quot;highlight sh&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; django_fixtures
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; python manage.py migrate
&lt;span class=&quot;go&quot;&gt;Operations to perform:&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  Apply all migrations: admin, auth, contenttypes, sessions&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Running migrations:&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  Applying contenttypes.0001_initial... OK&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  Applying auth.0001_initial... OK&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  Applying admin.0001_initial... OK&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  Applying admin.0002_logentry_remove_auto_add... OK&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  Applying admin.0003_logentry_add_action_flag_choices... OK&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  Applying contenttypes.0002_remove_content_type_name... OK&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  Applying auth.0002_alter_permission_name_max_length... OK&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  Applying auth.0003_alter_user_email_max_length... OK&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  Applying auth.0004_alter_user_username_opts... OK&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  Applying auth.0005_alter_user_last_login_null... OK&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  Applying auth.0006_require_contenttypes_0002... OK&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  Applying auth.0007_alter_validators_add_error_messages... OK&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  Applying auth.0008_alter_user_username_max_length... OK&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  Applying auth.0009_alter_user_last_name_max_length... OK&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  Applying auth.0010_alter_group_name_max_length... OK&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  Applying auth.0011_update_proxy_permissions... OK&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  Applying sessions.0001_initial... OK&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The output lists all the migrations Django applied. When starting a new project, Django applies migrations for built-in apps such as &lt;code&gt;auth&lt;/code&gt;, &lt;code&gt;sessions&lt;/code&gt;, and  &lt;code&gt;admin&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Now you’re ready to start writing tests and fixtures!&lt;/p&gt;
&lt;h3 id=&quot;creating-django-fixtures&quot;&gt;Creating Django Fixtures&lt;/h3&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/django-pytest-fixtures/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/django-pytest-fixtures/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Arduino With Python: How to Get Started</title>
      <id>https://realpython.com/courses/arduino-python/</id>
      <link href="https://realpython.com/courses/arduino-python/"/>
      <updated>2020-04-07T14:00:00+00:00</updated>
      <summary>In this step-by-step course, you&#39;ll discover how to use Arduino microcontrollers with Python to develop your own electronic projects. You&#39;ll learn how to set up circuits and write applications with the Firmata protocol. You&#39;ll control Arduino inputs and outputs and integrate the board with higher-level apps.</summary>
      <content type="html">
        &lt;p&gt;&lt;a href=&quot;http://www.circuitstoday.com/microcontroller-invention-history&quot;&gt;Microcontrollers&lt;/a&gt; have been around for a long time, and they&amp;rsquo;re used in everything from complex machinery to common household appliances. However, working with them has traditionally been reserved for those with formal technical training, such as technicians and electrical engineers.&lt;/p&gt;
&lt;p&gt;The emergence of &lt;strong&gt;Arduino&lt;/strong&gt; has made electronic application design much more accessible to all developers. In this course, you&amp;rsquo;ll discover how to use Arduino with Python to develop your own electronic projects.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;You&amp;rsquo;ll cover the basics of Arduino with Python and learn how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Set up electronic circuits&lt;/li&gt;
&lt;li&gt;Set up the Firmata protocol on Arduino&lt;/li&gt;
&lt;li&gt;Write basic applications for Arduino in Python&lt;/li&gt;
&lt;li&gt;Control analog and digital inputs and outputs&lt;/li&gt;
&lt;li&gt;Integrate Arduino sensors and switches with higher-level apps&lt;/li&gt;
&lt;li&gt;Trigger notifications on your PC and send emails using Arduino&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>How to Make an Instagram Bot With Python and InstaPy</title>
      <id>https://realpython.com/instagram-bot-python-instapy/</id>
      <link href="https://realpython.com/instagram-bot-python-instapy/"/>
      <updated>2020-04-06T14:00:00+00:00</updated>
      <summary>In this step-by-step tutorial, you&#39;ll learn all about how to use InstaPy to create an Instagram bot that can increase your follower and like count with minimal effort on your end. Along the way, you&#39;ll also learn about two tools that InstaPy uses under the hood: Selenium and the Page Object Pattern.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;What do &lt;a href=&quot;https://socialcaptain.com/pricing/&quot;&gt;SocialCaptain&lt;/a&gt;, &lt;a href=&quot;https://kicksta.co/pricing&quot;&gt;Kicksta&lt;/a&gt;, &lt;a href=&quot;https://instavast.com/pricing/&quot;&gt;Instavast&lt;/a&gt;, and &lt;a href=&quot;https://socialmediaexplorer.com/social-media-marketing/instagram-automation-tools/&quot;&gt;many other companies&lt;/a&gt; have in common? They all help you reach a greater audience, gain more followers, and get more likes on Instagram while you hardly lift a finger. They do it all through automation, and people pay them a good deal of money for it. But you can do the same thing—for free—using InstaPy!&lt;/p&gt;
&lt;p&gt;In this tutorial, you’ll learn how to build a bot with &lt;a href=&quot;https://realpython.com/learning-paths/python-basics-book/&quot;&gt;Python&lt;/a&gt; and &lt;a href=&quot;https://github.com/timgrossmann/InstaPy&quot;&gt;InstaPy&lt;/a&gt;, a library by &lt;a href=&quot;https://twitter.com/timigrossmann&quot;&gt;Tim Großmann&lt;/a&gt; which &lt;strong&gt;automates&lt;/strong&gt; your Instagram activities so that you gain more followers and likes with minimal manual input. Along the way, you’ll learn about browser automation with &lt;a href=&quot;https://realpython.com/modern-web-automation-with-python-and-selenium/&quot;&gt;Selenium&lt;/a&gt; and the &lt;strong&gt;Page Object Pattern&lt;/strong&gt;, which together serve as the basis for InstaPy.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How &lt;strong&gt;Instagram bots&lt;/strong&gt; work&lt;/li&gt;
&lt;li&gt;How to automate a browser with &lt;a href=&quot;https://realpython.com/headless-selenium-testing-with-python-and-phantomjs/&quot;&gt;Selenium&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;How to use the &lt;strong&gt;Page Object Pattern&lt;/strong&gt; for better readability and testability&lt;/li&gt;
&lt;li&gt;How to build an Instagram bot with &lt;strong&gt;InstaPy&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You’ll begin by learning how Instagram bots work before you build one.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; Make sure you check &lt;a href=&quot;https://help.instagram.com/581066165581870&quot;&gt;Instagram’s Terms of Use&lt;/a&gt; before implementing any kind of automation or scraping techniques.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Free Bonus:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-mastery-course/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-mastery-course&quot; data-focus=&quot;false&quot;&gt;5 Thoughts On Python Mastery&lt;/a&gt;, a free course for Python developers that shows you the roadmap and the mindset you&#39;ll need to take your Python skills to the next level.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;how-instagram-bots-work&quot;&gt;How Instagram Bots Work&lt;/h2&gt;
&lt;p&gt;How can an automation script gain you more followers and likes? Before answering this question, think about how an actual person gains more followers and likes. &lt;/p&gt;
&lt;p&gt;They do it by being consistently active on the platform. They post often, follow other people, and like and leave comments on other people’s posts. Bots work exactly the same way: They follow, like, and comment on a consistent basis according to the criteria you set. &lt;/p&gt;
&lt;p&gt;The better the criteria you set, the better your results will be. You want to make sure you’re targeting the right groups because the people your bot interacts with on Instagram will be more likely to interact with &lt;em&gt;your&lt;/em&gt; content. &lt;/p&gt;
&lt;p&gt;For example, if you’re selling women’s clothing on Instagram, then you can instruct your bot to like, comment on, and follow mostly women or profiles whose posts include hashtags such as &lt;code&gt;#beauty&lt;/code&gt;, &lt;code&gt;#fashion&lt;/code&gt;, or &lt;code&gt;#clothes&lt;/code&gt;. This makes it more likely that your target audience will notice your profile, follow you back, and start interacting with your posts.&lt;/p&gt;
&lt;p&gt;How does it work on the technical side, though? You can’t use the &lt;a href=&quot;https://www.instagram.com/developer/&quot;&gt;Instagram Developer API&lt;/a&gt; since it is fairly limited for this purpose. Enter &lt;strong&gt;browser automation&lt;/strong&gt;. It works in the following way:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;You serve it your credentials.&lt;/li&gt;
&lt;li&gt;You set the criteria for who to follow, what comments to leave, and which type of posts to like.&lt;/li&gt;
&lt;li&gt;Your bot opens a browser, types in &lt;code&gt;https://instagram.com&lt;/code&gt; on the address bar, logs in with your credentials, and starts doing the things you instructed it to do.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Next, you’ll build the initial version of your Instagram bot, which will automatically log in to your profile. Note that you won’t use InstaPy just yet.&lt;/p&gt;
&lt;h2 id=&quot;how-to-automate-a-browser&quot;&gt;How to Automate a Browser&lt;/h2&gt;
&lt;p&gt;For this version of your Instagram bot, you’ll be using &lt;a href=&quot;https://selenium.dev/&quot;&gt;Selenium&lt;/a&gt;, which is the tool that InstaPy uses under the hood.&lt;/p&gt;
&lt;p&gt;First, &lt;a href=&quot;https://selenium-python.readthedocs.io/installation.html&quot;&gt;install Selenium&lt;/a&gt;. During installation, make sure you also install the &lt;a href=&quot;https://selenium-python.readthedocs.io/installation.html#drivers&quot;&gt;Firefox WebDriver&lt;/a&gt; since the latest version of &lt;a href=&quot;https://github.com/timgrossmann/InstaPy/blob/master/CHANGELOG.md#breaking-changes&quot;&gt;InstaPy dropped support for Chrome&lt;/a&gt;. This also means that you need the &lt;a href=&quot;https://www.mozilla.org/en-US/firefox/new/&quot;&gt;Firefox browser&lt;/a&gt; installed on your computer.&lt;/p&gt;
&lt;p&gt;Now, create a Python file and write the following code in it:&lt;/p&gt;
&lt;div class=&quot;highlight python&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;lineno&quot;&gt; 1 &lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;time&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sleep&lt;/span&gt;
&lt;span class=&quot;lineno&quot;&gt; 2 &lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;selenium&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;webdriver&lt;/span&gt;
&lt;span class=&quot;lineno&quot;&gt; 3 &lt;/span&gt;
&lt;span class=&quot;lineno&quot;&gt; 4 &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;browser&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;webdriver&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Firefox&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;lineno&quot;&gt; 5 &lt;/span&gt;
&lt;span class=&quot;lineno&quot;&gt; 6 &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;browser&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;https://www.instagram.com/&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;lineno&quot;&gt; 7 &lt;/span&gt;
&lt;span class=&quot;lineno&quot;&gt; 8 &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sleep&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;lineno&quot;&gt; 9 &lt;/span&gt;
&lt;span class=&quot;lineno&quot;&gt;10 &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;browser&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;close&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Run the code and you’ll see that a Firefox browser opens and directs you to the Instagram login page. Here’s a line-by-line breakdown of the code:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Lines 1 and 2&lt;/strong&gt; import &lt;code&gt;sleep&lt;/code&gt; and &lt;code&gt;webdriver&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Line 4&lt;/strong&gt; initializes the Firefox driver and sets it to &lt;code&gt;browser&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Line 6&lt;/strong&gt; types &lt;code&gt;https://www.instagram.com/&lt;/code&gt; on the address bar and hits  &lt;span class=&quot;keys&quot;&gt;&lt;kbd class=&quot;key-enter&quot;&gt;Enter&lt;/kbd&gt;&lt;/span&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Line 8&lt;/strong&gt; waits for five seconds so you can see the result. Otherwise, it would close the browser instantly.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Line 10&lt;/strong&gt; closes the browser.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is the Selenium version of &lt;code&gt;Hello, World&lt;/code&gt;. Now you’re ready to add the code that logs in to your Instagram profile. But first, think about how you would log in to your profile manually. You would do the following:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Go to &lt;code&gt;https://www.instagram.com/&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Click the login link.&lt;/li&gt;
&lt;li&gt;Enter your credentials.&lt;/li&gt;
&lt;li&gt;Hit the login button.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The first step is already done by the code above. Now change it so that it clicks on the login link on the Instagram home page:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/instagram-bot-python-instapy/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/instagram-bot-python-instapy/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #3: Effective Python and Python at Google Scale</title>
      <id>https://realpython.com/podcasts/rpp/3/</id>
      <link href="https://realpython.com/podcasts/rpp/3/"/>
      <updated>2020-04-03T12:00:00+00:00</updated>
      <summary>In this episode, Christopher interviews Brett Slatkin about the 2nd edition of his book Effective Python. Brett talks about the revisions he made for the book, and updating it for the newest versions of Python 3. Christopher asks who is the intended developer for the book. Brett also discusses working on Google App Engine, and what it&#39;s like to develop and maintain Python applications at Google Scale. Brett mentions a brief anecdote about working with Guido van Rossum, while they both worked at Google. He also provides advice about maintaining a large and aging Python code base.</summary>
      <content type="html">
        &lt;p&gt;In this episode, Christopher interviews Brett Slatkin about the 2nd edition of his book Effective Python. Brett talks about the revisions he made for the book, and updating it for the newest versions of Python 3. Christopher asks who is the intended developer for the book. Brett also discusses working on Google App Engine, and what it&#39;s like to develop and maintain Python applications at Google Scale. Brett mentions a brief anecdote about working with Guido van Rossum, while they both worked at Google. He also provides advice about maintaining a large and aging Python code base.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Linked Lists in Python: An Introduction</title>
      <id>https://realpython.com/linked-lists-python/</id>
      <link href="https://realpython.com/linked-lists-python/"/>
      <updated>2020-04-01T14:00:00+00:00</updated>
      <summary>In this article, you&#39;ll learn what linked lists are and when to use them, such as when you want to implement queues, stacks, or graphs. You&#39;ll also learn how to use collections.deque to improve the performance of your linked lists and how to implement linked lists in your own projects.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;&lt;strong&gt;Linked lists&lt;/strong&gt; are like a lesser-known cousin of &lt;a href=&quot;https://realpython.com/python-lists-tuples/&quot;&gt;lists&lt;/a&gt;. They’re not as popular or as cool, and you might not even remember them from your algorithms class. But in the right context, they can really shine.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this article, you’ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What linked lists are and when you should use them&lt;/li&gt;
&lt;li&gt;How to use &lt;code&gt;collections.deque&lt;/code&gt; for all of your linked list needs&lt;/li&gt;
&lt;li&gt;How to implement your own linked lists&lt;/li&gt;
&lt;li&gt;What the other types of linked lists are and what they can be used for&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you’re looking to brush up on your coding skills for a job interview, or if you want to learn more about Python data structures besides the usual &lt;a href=&quot;https://realpython.com/python-dicts/&quot;&gt;dictionaries&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/python-lists-tuples/&quot;&gt;lists&lt;/a&gt;, then you’ve come to the right place!&lt;/p&gt;
&lt;p&gt;You can follow along with the examples in this tutorial by downloading the source code available at the link below:&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Get the Source Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/linked-lists/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-linked-lists&quot; data-focus=&quot;false&quot;&gt;Click here to get the source code you&#39;ll use&lt;/a&gt; to learn about linked lists in this tutorial.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;understanding-linked-lists&quot;&gt;Understanding Linked Lists&lt;/h2&gt;
&lt;p&gt;Linked lists are an ordered collection of objects. So what makes them different from normal lists? Linked lists differ from lists in the way that they store elements in memory. While lists use a contiguous memory block to store references to their data, linked lists store references as part of their own elements.&lt;/p&gt;
&lt;h3 id=&quot;main-concepts&quot;&gt;Main Concepts&lt;/h3&gt;
&lt;p&gt;Before going more in depth on what linked lists are and how you can use them, you should first learn how they are structured. Each element of a linked list is called a &lt;strong&gt;node&lt;/strong&gt;, and every node has two different fields:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Data&lt;/strong&gt; contains the value to be stored in the node.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Next&lt;/strong&gt; contains a reference to the next node on the list.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Here’s what a typical node looks like:&lt;/p&gt;
&lt;figure class=&quot;figure mx-auto d-block&quot;&gt;&lt;a href=&quot;https://files.realpython.com/media/Group_12_2.0ded5fffe97a.png&quot; target=&quot;_blank&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid mx-auto d-block w-25&quot; src=&quot;https://files.realpython.com/media/Group_12_2.0ded5fffe97a.png&quot; width=&quot;350&quot; height=&quot;178&quot; srcset=&quot;https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/Group_12_2.0ded5fffe97a.png&amp;amp;w=87&amp;amp;sig=e715fb5f46b35533467e2908213482deee87f3bb 87w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/Group_12_2.0ded5fffe97a.png&amp;amp;w=175&amp;amp;sig=5c87aa53066b38fc5452c982e13db3c5795fed29 175w, https://files.realpython.com/media/Group_12_2.0ded5fffe97a.png 350w&quot; sizes=&quot;75vw&quot; alt=&quot;Example Node of a Linked List&quot;&gt;&lt;/a&gt;&lt;figcaption class=&quot;figure-caption text-center&quot;&gt;Node&lt;/figcaption&gt;&lt;/figure&gt;

&lt;p&gt;A linked list is a collection of nodes. The first node is called the &lt;strong&gt;&lt;code&gt;head&lt;/code&gt;&lt;/strong&gt;, and it’s used as the starting point for any iteration through the list. The last node must have its &lt;code&gt;next&lt;/code&gt; reference pointing to &lt;strong&gt;&lt;code&gt;None&lt;/code&gt;&lt;/strong&gt; to determine the end of the list. Here’s how it looks:&lt;/p&gt;
&lt;figure class=&quot;figure mx-auto d-block&quot;&gt;&lt;a href=&quot;https://files.realpython.com/media/Group_14.27f7c4c6ec02.png&quot; target=&quot;_blank&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid mx-auto d-block w-66&quot; src=&quot;https://files.realpython.com/media/Group_14.27f7c4c6ec02.png&quot; width=&quot;1248&quot; height=&quot;332&quot; srcset=&quot;https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/Group_14.27f7c4c6ec02.png&amp;amp;w=312&amp;amp;sig=235b5d949b415feb15cc7f2111453b2db310e0ac 312w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/Group_14.27f7c4c6ec02.png&amp;amp;w=624&amp;amp;sig=8c9910ef42184ff2095ddb64d8db9ddbb874d57a 624w, https://files.realpython.com/media/Group_14.27f7c4c6ec02.png 1248w&quot; sizes=&quot;75vw&quot; alt=&quot;Example Structure of a Linked List&quot;&gt;&lt;/a&gt;&lt;figcaption class=&quot;figure-caption text-center&quot;&gt;Linked List&lt;/figcaption&gt;&lt;/figure&gt;

&lt;p&gt;Now that you know how a linked list is structured, you’re ready to look at some practical use cases for it.&lt;/p&gt;
&lt;h3 id=&quot;practical-applications&quot;&gt;Practical Applications&lt;/h3&gt;
&lt;p&gt;Linked lists serve a variety of purposes in the real world. They can be used to implement (&lt;em&gt;spoiler alert!&lt;/em&gt;) queues or &lt;a href=&quot;https://realpython.com/courses/python-stack/&quot;&gt;stacks&lt;/a&gt; as well as graphs. They’re also useful for much more complex tasks, such as lifecycle management for an operating system application.&lt;/p&gt;
&lt;h4 id=&quot;queues-or-stacks&quot;&gt;Queues or Stacks&lt;/h4&gt;
&lt;p&gt;Queues and stacks differ only in the way elements are retrieved. For a queue, you use a &lt;strong&gt;First-In/First-Out&lt;/strong&gt; (FIFO) approach. That means that the first element inserted in the list is the first one to be retrieved:&lt;/p&gt;
&lt;figure class=&quot;figure mx-auto d-block&quot;&gt;&lt;a href=&quot;https://files.realpython.com/media/Group_6_3.67b18836f065.png&quot; target=&quot;_blank&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid mx-auto d-block w-50&quot; src=&quot;https://files.realpython.com/media/Group_6_3.67b18836f065.png&quot; width=&quot;752&quot; height=&quot;384&quot; srcset=&quot;https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/Group_6_3.67b18836f065.png&amp;amp;w=188&amp;amp;sig=64b8e452670c85086910d4b316219c54ac26a23c 188w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/Group_6_3.67b18836f065.png&amp;amp;w=376&amp;amp;sig=634851235fcf3878acef94566ce9fdc3f95b3fd2 376w, https://files.realpython.com/media/Group_6_3.67b18836f065.png 752w&quot; sizes=&quot;75vw&quot; alt=&quot;Example Structure of a Queue&quot;&gt;&lt;/a&gt;&lt;figcaption class=&quot;figure-caption text-center&quot;&gt;Queue&lt;/figcaption&gt;&lt;/figure&gt;

&lt;p&gt;In the diagram above, you can see the &lt;strong&gt;front&lt;/strong&gt; and &lt;strong&gt;rear&lt;/strong&gt; elements of the queue. When you append new elements to the queue, they’ll go to the rear end. When you retrieve elements, they’ll be taken from the front of the queue.&lt;/p&gt;
&lt;p&gt;For a stack, you use a &lt;strong&gt;Last-In/Fist-Out&lt;/strong&gt; (LIFO) approach, meaning that the last element inserted in the list is the first to be retrieved:&lt;/p&gt;
&lt;figure class=&quot;figure mx-auto d-block&quot;&gt;&lt;a href=&quot;https://files.realpython.com/media/Group_7_5.930e25fcf2a0.png&quot; target=&quot;_blank&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid mx-auto d-block w-33&quot; src=&quot;https://files.realpython.com/media/Group_7_5.930e25fcf2a0.png&quot; width=&quot;482&quot; height=&quot;592&quot; srcset=&quot;https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/Group_7_5.930e25fcf2a0.png&amp;amp;w=120&amp;amp;sig=2cef353d66793c8b5437566b70710c57f4c50f67 120w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/Group_7_5.930e25fcf2a0.png&amp;amp;w=241&amp;amp;sig=4c48e4350c3a6e5f4e918c0c8dcedfd54675aeea 241w, https://files.realpython.com/media/Group_7_5.930e25fcf2a0.png 482w&quot; sizes=&quot;75vw&quot; alt=&quot;Example Structure of a Stack&quot;&gt;&lt;/a&gt;&lt;figcaption class=&quot;figure-caption text-center&quot;&gt;Stack&lt;/figcaption&gt;&lt;/figure&gt;

&lt;p&gt;In the above diagram you can see that the first element inserted on the stack (index &lt;code&gt;0&lt;/code&gt;) is at the bottom, and the last element inserted is at the top. Since stacks use the LIFO approach, the last element inserted (at the top) will be the first to be retrieved.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/linked-lists-python/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/linked-lists-python/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Comparing Python Objects the Right Way: &quot;is&quot; vs &quot;==&quot;</title>
      <id>https://realpython.com/courses/python-is-identity-vs-equality/</id>
      <link href="https://realpython.com/courses/python-is-identity-vs-equality/"/>
      <updated>2020-03-31T14:00:00+00:00</updated>
      <summary>In this quick and practical course, you&#39;ll learn when to use the Python is, is not, == and != operators. You&#39;ll see what these comparison operators do under the hood, dive into some quirks of object identity and interning, and define a custom class.</summary>
      <content type="html">
        &lt;p&gt;There&amp;rsquo;s a subtle difference between the Python identity operator (&lt;code&gt;is&lt;/code&gt;) and the equality operator (&lt;code&gt;==&lt;/code&gt;). Your code can run fine when you use the Python &lt;strong&gt;&lt;code&gt;is&lt;/code&gt; operator&lt;/strong&gt; to compare numbers, until it suddenly &lt;a href=&quot;https://medium.com/peloton-engineering/the-dangers-of-using-is-in-python-f42941124027&quot;&gt;doesn&amp;rsquo;t&lt;/a&gt;. You might have heard somewhere that the Python &lt;code&gt;is&lt;/code&gt; operator is faster than the &lt;strong&gt;&lt;code&gt;==&lt;/code&gt; operator&lt;/strong&gt;, or you may feel that it looks more &lt;a href=&quot;https://realpython.com/tutorials/best-practices/&quot;&gt;Pythonic&lt;/a&gt;. However, it&amp;rsquo;s crucial to keep in mind that these operators don&amp;rsquo;t behave quite the same.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;==&lt;/code&gt; operator compares the value or &lt;strong&gt;equality&lt;/strong&gt; of two objects, whereas the Python &lt;code&gt;is&lt;/code&gt; operator checks whether two variables point to the same object in memory. In the vast majority of cases, this means you should use the equality operators &lt;code&gt;==&lt;/code&gt; and &lt;code&gt;!=&lt;/code&gt;, except when you&amp;rsquo;re comparing to &lt;code&gt;None&lt;/code&gt;. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What the difference is between &lt;strong&gt;object equality and identity&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;When to use equality and identity operators to &lt;strong&gt;compare objects&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;What these &lt;strong&gt;Python operators&lt;/strong&gt; do under the hood&lt;/li&gt;
&lt;li&gt;Why using &lt;code&gt;is&lt;/code&gt; and &lt;code&gt;is not&lt;/code&gt; to compare values leads to &lt;strong&gt;unexpected behavior&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to write a &lt;strong&gt;custom &lt;code&gt;__eq__()&lt;/code&gt; class method&lt;/strong&gt; to define equality operator behavior&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>How to Use any() in Python</title>
      <id>https://realpython.com/any-python/</id>
      <link href="https://realpython.com/any-python/"/>
      <updated>2020-03-30T14:00:00+00:00</updated>
      <summary>If you&#39;ve ever wondered how to simplify complex conditionals by determining if at least one in a series of conditions is true, then look no further. This tutorial will teach you all about how to use any() in Python to do just that.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;As a Python programmer, you’ll frequently deal with &lt;a href=&quot;https://realpython.com/lessons/booleans/&quot;&gt;Booleans&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/python-conditional-statements/&quot;&gt;conditional statements&lt;/a&gt;—sometimes very complex ones. In those situations, you may need to rely on tools that can simplify logic and consolidate information. Fortunately,  &lt;strong&gt;&lt;code&gt;any()&lt;/code&gt;&lt;/strong&gt; in Python is such a tool. It looks through the elements in an iterable and returns a single value indicating whether any element is true in a Boolean context, or &lt;strong&gt;truthy.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How to use &lt;code&gt;any()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;How to decide between &lt;code&gt;any()&lt;/code&gt; and &lt;code&gt;or&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Let’s dive right in!&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Python Pit Stop:&lt;/strong&gt; This tutorial is a &lt;strong&gt;quick&lt;/strong&gt; and &lt;strong&gt;practical&lt;/strong&gt; way to find the info you need, so you’ll be back to your project in no time!&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Free Bonus:&lt;/strong&gt; &lt;a href=&quot;&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-cheat-sheet-shortened&quot; data-focus=&quot;false&quot;&gt;Click here to get a Python Cheat Sheet&lt;/a&gt; and learn the basics of Python 3, like working with data types, dictionaries, lists, and Python functions.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;how-to-use-any-in-python&quot;&gt;How to Use &lt;code&gt;any()&lt;/code&gt; in Python&lt;/h2&gt;
&lt;p&gt;Imagine that you’re writing a program for your employer’s recruiting department. You might want to schedule interviews with candidates who meet any of the following criteria:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Know Python already&lt;/li&gt;
&lt;li&gt;Have five or more years of developer experience&lt;/li&gt;
&lt;li&gt;Have a degree&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;One tool you could use to write this conditional expression is &lt;a href=&quot;https://realpython.com/python-or-operator/&quot;&gt;&lt;code&gt;or&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight python&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;# recruit_developer.py&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;schedule_interview&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;applicant&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sa&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Scheduled interview with &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{applicant[&#39;name&#39;]}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;applicants&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Devon Smith&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;programming_languages&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;c++&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;ada&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;years_of_experience&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;has_degree&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;email_address&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;devon@email.com&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Susan Jones&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;programming_languages&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;python&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;javascript&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;years_of_experience&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;has_degree&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;email_address&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;susan@email.com&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Sam Hughes&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;programming_languages&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;java&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;years_of_experience&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;has_degree&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;email_address&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;sam@email.com&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;applicant&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;applicants&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;knows_python&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;python&quot;&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;applicant&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;programming_languages&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;experienced_dev&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;applicant&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;years_of_experience&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt;

    &lt;span class=&quot;n&quot;&gt;meets_criteria&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;knows_python&lt;/span&gt;
        &lt;span class=&quot;ow&quot;&gt;or&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;experienced_dev&lt;/span&gt;
        &lt;span class=&quot;ow&quot;&gt;or&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;applicant&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;has_degree&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;meets_criteria&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;schedule_interview&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;applicant&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;In the above example, you check each applicant’s credentials and schedule an interview if the applicant meets any of your three criteria.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Technical Detail:&lt;/strong&gt; Python’s &lt;code&gt;any()&lt;/code&gt; and &lt;code&gt;or&lt;/code&gt; aren’t limited to evaluating Boolean expressions. Instead, Python performs a &lt;a href=&quot;https://docs.python.org/3/library/stdtypes.html#truth-value-testing&quot;&gt;truth value test&lt;/a&gt; on each argument, evaluating whether the expression is &lt;a href=&quot;https://realpython.com/python-operators-expressions/#evaluation-of-non-boolean-values-in-boolean-context&quot;&gt;&lt;strong&gt;truthy&lt;/strong&gt; or &lt;strong&gt;falsy&lt;/strong&gt;&lt;/a&gt;. For example, nonzero integer values are considered truthy and zero is considered falsy:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;span class=&quot;repl-toggle&quot; title=&quot;Toggle REPL prompts and output&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;or&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;In this example, &lt;code&gt;or&lt;/code&gt; evaluated the nonzero value &lt;code&gt;1&lt;/code&gt; as truthy even though it’s not of type Boolean. &lt;code&gt;or&lt;/code&gt; returned &lt;code&gt;1&lt;/code&gt; and didn’t need to evaluate the truthiness of &lt;code&gt;0&lt;/code&gt;. Later in this tutorial, you’ll learn more about the return value and argument evaluation of &lt;code&gt;or&lt;/code&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;If you execute this code, then you’ll see that Susan and Sam will get interviews:&lt;/p&gt;
&lt;div class=&quot;highlight sh&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; python recruit_developer.py
&lt;span class=&quot;go&quot;&gt;Scheduled interview with Susan Jones&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Scheduled interview with Sam Hughes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/any-python/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/any-python/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #2: Learn Python Skills While Creating Games</title>
      <id>https://realpython.com/podcasts/rpp/2/</id>
      <link href="https://realpython.com/podcasts/rpp/2/"/>
      <updated>2020-03-27T12:00:00+00:00</updated>
      <summary>In this episode, Christopher interviews Jon Fincher from the Real Python Team. Jon talks about his recent articles on PyGame and Arcade. They discuss if game programming is a good way to develop your Python programming skills, and if a game would make a good portfolio piece. He compares the two popular Python game libraries of Arcade and PyGame, and discusses about how to find assets for your own creations.</summary>
      <content type="html">
        &lt;p&gt;In this episode, Christopher interviews Jon Fincher from the Real Python Team. Jon talks about his recent articles on PyGame and Arcade. They discuss if game programming is a good way to develop your Python programming skills, and if a game would make a good portfolio piece. He compares the two popular Python game libraries of Arcade and PyGame, and discusses about how to find assets for your own creations.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>SimPy: Simulating Real-World Processes With Python</title>
      <id>https://realpython.com/simpy-simulating-with-python/</id>
      <link href="https://realpython.com/simpy-simulating-with-python/"/>
      <updated>2020-03-25T14:00:00+00:00</updated>
      <summary>In this step-by-step tutorial, you&#39;ll see how you can use the SimPy package to model real-world processes with a high potential for congestion. You&#39;ll create an algorithm to approximate a complex system, and then you&#39;ll design and run a simulation of that system in Python.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;The real world is full of systems, like airports and highways, that frequently experience congestion and delay. When these systems are not optimized, their inefficiency can lead to countless unhappy customers and hours of wasted time. In this tutorial, you’ll learn how to use Python’s &lt;strong&gt;&lt;code&gt;simpy&lt;/code&gt;&lt;/strong&gt; framework to create virtual simulations that will help you solve problems like these.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll learn how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Use&lt;/strong&gt; a simulation to model a real-world process&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Create&lt;/strong&gt; a step-by-step algorithm to approximate a complex system&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Design&lt;/strong&gt; and run a real-world simulation in Python with &lt;code&gt;simpy&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In this tutorial, you’ll create a simulation for a local movie theater. Your goal is to provide the manager with a script to help find the optimal number of employees to have on staff. You can download the source code for this script by clicking on the link below:&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Download Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/simpy/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-simpy&quot; data-focus=&quot;false&quot;&gt;Click here to download the code you&#39;ll use&lt;/a&gt; to learn about SimPy in this tutorial.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;what-simulation-is&quot;&gt;What Simulation Is&lt;/h2&gt;
&lt;p&gt;A &lt;strong&gt;simulation&lt;/strong&gt; is a representation of a real-world system. One can use mathematical or computational models of this system to study how it works, or what happens when parts of it are changed. Simulations are used in airports, restaurants, mechanics, government agencies, and many other systems where poor resource allocation can lead to congestion, customer dissatisfaction, and critical transportation delays.&lt;/p&gt;
&lt;p&gt;A &lt;strong&gt;system&lt;/strong&gt; can be any environment where things happen. Examples of real-world systems include car washes, banks, manufacturing plants, airports, post offices, call centers, and more. These systems have &lt;strong&gt;agents&lt;/strong&gt; that undergo &lt;strong&gt;processes&lt;/strong&gt; within them. For instance:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A car wash&lt;/strong&gt; will have cars go through the washing process.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An airport&lt;/strong&gt; will have passengers go through the security check process.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A call center&lt;/strong&gt; will have customers go through the process of speaking with a telemarketer.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This relationship is summed up in the table below:&lt;/p&gt;
&lt;div class=&quot;table-responsive&quot;&gt;
&lt;table class=&quot;table table-hover&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;System&lt;/th&gt;
&lt;th&gt;Agent&lt;/th&gt;
&lt;th&gt;Process&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Car wash&lt;/td&gt;
&lt;td&gt;Car&lt;/td&gt;
&lt;td&gt;Wash&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Airport&lt;/td&gt;
&lt;td&gt;Passenger&lt;/td&gt;
&lt;td&gt;Security check&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Call center&lt;/td&gt;
&lt;td&gt;Customer&lt;/td&gt;
&lt;td&gt;Speak with a telemarketer&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;Understanding the processes that agents go through within a system is an important component of logistical planning, especially for large-scale organizations. For example, an airport can see passenger wait times at a security checkpoint skyrocket if there aren’t enough workers that day. Similarly, time-sensitive mail can be delayed by days (or even weeks) if it isn’t routed properly.&lt;/p&gt;
&lt;p&gt;These instances of congestion can have &lt;strong&gt;real-life consequences&lt;/strong&gt; on time and money, so it’s important to be able to model these processes beforehand. This gives you an idea of where the system might run into problems and how resources should be allocated ahead of time to solve those problems in the most efficient way possible.&lt;/p&gt;
&lt;h2 id=&quot;how-simulation-works&quot;&gt;How Simulation Works&lt;/h2&gt;
&lt;p&gt;In Python, you can use the &lt;a href=&quot;https://simpy.readthedocs.io/en/latest/&quot;&gt;&lt;code&gt;simpy&lt;/code&gt;&lt;/a&gt; framework for event simulation. First, take a quick look at how a simulated process would run in Python. Below is a code snippet from a simulation of a security checkpoint system. The following three lines of code set up the environment, pass all necessary functions, and run the simulation:&lt;/p&gt;
&lt;div class=&quot;highlight python&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;# Set up the environment&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;env&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;simpy&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Environment&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# Assume you&#39;ve defined checkpoint_run() beforehand&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;env&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;process&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;checkpoint_run&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;env&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;num_booths&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;check_time&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;passenger_arrival&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# Let&#39;s go!&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;env&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;run&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;until&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The first line of code above establishes the &lt;strong&gt;environment&lt;/strong&gt;. You’ll do this by assigning &lt;code&gt;simpy.Environment()&lt;/code&gt; to the desired variable. Here, it’s simply named &lt;code&gt;env&lt;/code&gt;. This tells &lt;code&gt;simpy&lt;/code&gt; to create an environment object named &lt;code&gt;env&lt;/code&gt; that will manage the simulation time and move the simulation through each subsequent time step.&lt;/p&gt;
&lt;p&gt;Once you have your environment established, you’ll pass in all of the variables that will act as your &lt;strong&gt;parameters&lt;/strong&gt;. These are the things you can vary to see how the system will react to changes. For this security checkpoint system, you’re using the following parameters:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;env&lt;/code&gt;:&lt;/strong&gt; the environment object to schedule and process events&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;num_booths&lt;/code&gt;:&lt;/strong&gt; the number of ID check booths&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;check_time:&lt;/code&gt;&lt;/strong&gt; the length of time it takes to check a passenger’s ID&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;passenger_arrival&lt;/code&gt;:&lt;/strong&gt; the rate at which passengers arrive at the queue&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Then, it’s time to run the simulation! You can do this by calling &lt;code&gt;env.run()&lt;/code&gt; and specifying how long you want the simulation to run for. The simulation runs in minutes, so this sample code will run the simulation for 10 real-time minutes.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Don’t worry! You won’t have to wait 10 actual minutes for the simulation to finish. Because simulation gives you a virtual look at a real-time process, those 10 minutes will pass in mere seconds on the computer.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;To recap, here are the three steps to running a simulation in Python:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Establish&lt;/strong&gt; the environment.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Pass&lt;/strong&gt; in the parameters.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Run&lt;/strong&gt; the simulation.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;But there’s a lot more going on underneath the hood! You’ll need to understand how to choose those parameters, and you’ll have to define all the functions that will be called when the simulation is run.&lt;/p&gt;
&lt;p&gt;Let’s get started!&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/simpy-simulating-with-python/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/simpy-simulating-with-python/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Using NumPy&#39;s np.arange() Effectively</title>
      <id>https://realpython.com/courses/numpy-arange/</id>
      <link href="https://realpython.com/courses/numpy-arange/"/>
      <updated>2020-03-24T14:00:00+00:00</updated>
      <summary>In this step-by-step course, you&#39;ll learn how to use the NumPy arange() function, which is one of the routines for array creation based on numerical ranges. np.arange() returns arrays with evenly spaced values</summary>
      <content type="html">
        &lt;p&gt;&lt;strong&gt;NumPy&lt;/strong&gt; is the fundamental Python library for numerical computing. Its most important type is an &lt;strong&gt;array type&lt;/strong&gt; called &lt;code&gt;ndarray&lt;/code&gt;. NumPy offers a lot of &lt;a href=&quot;https://docs.scipy.org/doc/numpy/reference/routines.array-creation.html&quot;&gt;array creation routines&lt;/a&gt; for different circumstances. &lt;strong&gt;&lt;code&gt;arange()&lt;/code&gt;&lt;/strong&gt; is one such function based on &lt;strong&gt;numerical ranges&lt;/strong&gt;. It&amp;rsquo;s often referred to as &lt;code&gt;np.arange()&lt;/code&gt; because &lt;code&gt;np&lt;/code&gt; is a widely used abbreviation for NumPy.&lt;/p&gt;
&lt;p&gt;Creating NumPy arrays is important when you&amp;rsquo;re working with other Python libraries that rely on them, like SciPy, Pandas, Matplotlib, scikit-learn, and more. NumPy is suitable for creating and working with arrays because it offers &lt;a href=&quot;https://docs.scipy.org/doc/numpy/reference/routines.html&quot;&gt;useful routines&lt;/a&gt;, enables &lt;a href=&quot;https://realpython.com/numpy-tensorflow-performance/&quot;&gt;performance boosts&lt;/a&gt;, and allows you to write &lt;a href=&quot;https://realpython.com/numpy-array-programming/&quot;&gt;concise code&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this course, you&amp;rsquo;ll know:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What &lt;code&gt;np.arange()&lt;/code&gt; is&lt;/li&gt;
&lt;li&gt;How to use &lt;code&gt;np.arange()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;How &lt;code&gt;np.arange()&lt;/code&gt; compares to the Python built-in class &lt;a href=&quot;https://realpython.com/python-range/&quot;&gt;&lt;code&gt;range&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Which routines are similar to &lt;code&gt;np.arange()&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Let&amp;rsquo;s see &lt;strong&gt;&lt;code&gt;np.arange()&lt;/code&gt;&lt;/strong&gt; in action!&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Python math Module: Everything You Need to Know</title>
      <id>https://realpython.com/python-math-module/</id>
      <link href="https://realpython.com/python-math-module/"/>
      <updated>2020-03-23T14:00:00+00:00</updated>
      <summary>In this step-by-step tutorial, you’ll learn all about Python’s math module for higher-level mathematical functions. Whether you’re working on a scientific project, a financial application, or any other type of programming endeavor, you just can’t escape the need for math!</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;In this article, you’ll learn all about Python’s &lt;strong&gt;&lt;code&gt;math&lt;/code&gt;&lt;/strong&gt; module. Mathematical calculations are an essential part of most Python development. Whether you’re working on a scientific project, a financial application, or any other type of programming endeavor, you just can’t escape the need for math.&lt;/p&gt;
&lt;p&gt;For straightforward mathematical calculations in Python, you can use the built-in mathematical &lt;strong&gt;operators&lt;/strong&gt;, such as addition (&lt;code&gt;+&lt;/code&gt;), subtraction (&lt;code&gt;-&lt;/code&gt;), division (&lt;code&gt;/&lt;/code&gt;), and multiplication (&lt;code&gt;*&lt;/code&gt;). But more advanced operations, such as exponential, logarithmic, trigonometric, or power functions, are not built in. Does that mean you need to implement all of these functions from scratch?&lt;/p&gt;
&lt;p&gt;Fortunately, no. Python provides a &lt;strong&gt;module&lt;/strong&gt; specifically designed for higher-level mathematical operations: the &lt;code&gt;math&lt;/code&gt; module.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this article, you’ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What the Python &lt;code&gt;math&lt;/code&gt; module is&lt;/li&gt;
&lt;li&gt;How to use &lt;code&gt;math&lt;/code&gt; module functions to solve real-life problems&lt;/li&gt;
&lt;li&gt;What the constants of the &lt;code&gt;math&lt;/code&gt; module are, including pi, tau, and Euler’s number&lt;/li&gt;
&lt;li&gt;What the differences between built-in functions and &lt;code&gt;math&lt;/code&gt; functions are&lt;/li&gt;
&lt;li&gt;What the differences between &lt;code&gt;math&lt;/code&gt;, &lt;code&gt;cmath&lt;/code&gt;, and NumPy are&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A background in mathematics will be helpful here, but don’t worry if math isn’t your strong suit. This article will explain the basics of everything you need to know.&lt;/p&gt;
&lt;p&gt;So let’s get started!&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Free Download:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-tricks-sample-pdf/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-tricks-sample-pdf&quot; data-focus=&quot;false&quot;&gt;Get a sample chapter from Python Tricks: The Book&lt;/a&gt; that shows you Python&#39;s best practices with simple examples you can apply instantly to write more beautiful + Pythonic code.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;getting-to-know-the-python-math-module&quot;&gt;Getting to Know the Python &lt;code&gt;math&lt;/code&gt; Module&lt;/h2&gt;
&lt;p&gt;The &lt;a href=&quot;https://docs.python.org/3/library/math.html&quot;&gt;Python &lt;code&gt;math&lt;/code&gt; module&lt;/a&gt; is an important feature designed to deal with mathematical operations. It comes packaged with the standard Python release and has been there from the beginning. Most of the &lt;code&gt;math&lt;/code&gt; module’s functions are thin wrappers around the C platform’s mathematical functions. Since its underlying functions are written in &lt;a href=&quot;https://realpython.com/cpython-source-code-guide/&quot;&gt;CPython&lt;/a&gt;, the &lt;code&gt;math&lt;/code&gt; module is efficient and conforms to the &lt;a href=&quot;http://www.iso-9899.info/wiki/The_Standard&quot;&gt;C standard&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The Python &lt;code&gt;math&lt;/code&gt; module offers you the ability to perform common and useful mathematical calculations within your application. Here are a few practical uses for the &lt;code&gt;math&lt;/code&gt; module:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Calculating combinations and permutations using factorials&lt;/li&gt;
&lt;li&gt;Calculating the height of a pole using trigonometric functions&lt;/li&gt;
&lt;li&gt;Calculating radioactive decay using the exponential function&lt;/li&gt;
&lt;li&gt;Calculating the curve of a suspension bridge using hyperbolic functions&lt;/li&gt;
&lt;li&gt;Solving quadratic equations&lt;/li&gt;
&lt;li&gt;Simulating periodic functions, such as sound and light waves, using trigonometric functions&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Since the &lt;code&gt;math&lt;/code&gt; module comes packaged with the Python release, you don’t have to install it separately. Using it is just a matter of &lt;a href=&quot;https://realpython.com/absolute-vs-relative-python-imports/&quot;&gt;importing the module&lt;/a&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;span class=&quot;repl-toggle&quot; title=&quot;Toggle REPL prompts and output&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;math&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You can import the Python &lt;code&gt;math&lt;/code&gt; module using the above command. After importing, you can use it straightaway.&lt;/p&gt;
&lt;h2 id=&quot;constants-of-the-math-module&quot;&gt;Constants of the &lt;code&gt;math&lt;/code&gt; Module&lt;/h2&gt;
&lt;p&gt;The Python &lt;code&gt;math&lt;/code&gt; module offers a variety of predefined &lt;strong&gt;constants&lt;/strong&gt;. Having access to these constants provides several advantages. For one, you don’t have to manually hardcode them into your application, which saves you a lot of time. Plus, they provide consistency throughout your code. The module includes several famous mathematical constants and important values:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Pi&lt;/li&gt;
&lt;li&gt;Tau&lt;/li&gt;
&lt;li&gt;Euler’s number&lt;/li&gt;
&lt;li&gt;Infinity&lt;/li&gt;
&lt;li&gt;Not a number (NaN)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In this section, you’ll learn about the constants and how to use them in your Python code.&lt;/p&gt;
&lt;h3 id=&quot;pi&quot;&gt;Pi&lt;/h3&gt;
&lt;p&gt;Pi (π) is the ratio of a circle’s circumference (&lt;em&gt;c&lt;/em&gt;) to its diameter (&lt;em&gt;d&lt;/em&gt;): &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;π = c/d &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This ratio is always the same for any circle.&lt;/p&gt;
&lt;p&gt;Pi is an &lt;strong&gt;irrational number&lt;/strong&gt;, which means it can’t be expressed as a simple fraction. Therefore, pi has an infinite number of decimal places, but it can be approximated as 22/7, or 3.141.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Interesting Fact:&lt;/strong&gt; Pi is the most recognized and well-known mathematical constant in the world. It has its own celebration date, called &lt;a href=&quot;https://www.piday.org/&quot;&gt;Pi Day&lt;/a&gt;, which falls on March 14th (3/14).&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-math-module/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-math-module/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast Is Here!</title>
      <id>https://realpython.com/real-python-podcast-launch/</id>
      <link href="https://realpython.com/real-python-podcast-launch/"/>
      <updated>2020-03-20T20:18:40+00:00</updated>
      <summary>The Real Python Podcast is finally live! Tune in for interesting guests, interviews with expert Pythonistas, and lots of behind-the-scenes with the Real Python Team.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;The Real Python Podcast is finally live! Tune in for interesting guests, interviews with expert Pythonistas, and lots of behind-the-scenes with the Real Python Team. &lt;/p&gt;
&lt;p&gt;Today we’re officially launching the &lt;a href=&quot;https://realpython.com/podcasts/rpp/&quot;&gt;&lt;strong&gt;Real Python Podcast&lt;/strong&gt;&lt;/a&gt;, a new (and freely accessible) podcast for Pythonistas like you.&lt;/p&gt;
&lt;p&gt;This has been in the making for a while, and both Christopher and I are super proud to finally release the first episode to you this week.&lt;/p&gt;
&lt;p&gt;We’ll have a roster of interesting guests for you, interviews with expert Pythonistas, and lots of behind-the-scenes with the Real Python Team. &lt;/p&gt;
&lt;p&gt;Here’s more info about the show and how you can listen to it:&lt;/p&gt;
&lt;h2 id=&quot;what-is-the-real-python-podcast&quot;&gt;What Is the Real Python Podcast?&lt;/h2&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/real-python-podcast-launch/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/real-python-podcast-launch/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #1: Python Decorators and Writing for Real Python</title>
      <id>https://realpython.com/podcasts/rpp/1/</id>
      <link href="https://realpython.com/podcasts/rpp/1/"/>
      <updated>2020-03-20T14:00:00+00:00</updated>
      <summary>In this first episode, Christopher interviews Geir Arne Hjelle from the Real Python Team.

You’ll learn about Geir Arne’s background as a Pythonista and PyCon speaker, the tutorials he’s written for the site, how Python decorators can help you write better code, and what Real Python’s tutorial publishing process looks like behind the scenes.</summary>
      <content type="html">
        &lt;p&gt;In this first episode, Christopher interviews Geir Arne Hjelle from the Real Python Team.

You’ll learn about Geir Arne’s background as a Pythonista and PyCon speaker, the tutorials he’s written for the site, how Python decorators can help you write better code, and what Real Python’s tutorial publishing process looks like behind the scenes.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Python Scope &amp; the LEGB Rule: Resolving Names in Your Code</title>
      <id>https://realpython.com/python-scope-legb-rule/</id>
      <link href="https://realpython.com/python-scope-legb-rule/"/>
      <updated>2020-03-18T14:00:00+00:00</updated>
      <summary>In this step-by-step tutorial, you&#39;ll learn what scopes are, how they work, and how to use them effectively to avoid name collisions in your code. Additionally, you&#39;ll learn how to take advantage of a Python scope to write more maintainable and less buggy code.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;The concept of &lt;strong&gt;scope&lt;/strong&gt; rules how &lt;a href=&quot;https://realpython.com/python-variables/&quot;&gt;variables&lt;/a&gt; and names are looked up in your code. It determines the visibility of a variable within the code. The scope of a name or variable depends on the place in your code where you create that variable. The Python scope concept is generally presented using a rule known as the &lt;strong&gt;LEGB rule&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The letters in the acronym LEGB stand for &lt;strong&gt;Local, Enclosing, Global, and Built-in&lt;/strong&gt; scopes. This summarizes not only the Python scope levels but also the sequence of steps that Python follows when resolving names in a program.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What &lt;strong&gt;scopes&lt;/strong&gt; are and how they work in Python&lt;/li&gt;
&lt;li&gt;Why it’s important to know about &lt;strong&gt;Python scope&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;What the &lt;strong&gt;LEGB rule&lt;/strong&gt; is and how Python uses it to resolve names&lt;/li&gt;
&lt;li&gt;How to modify the &lt;strong&gt;standard behavior&lt;/strong&gt; of Python scope using &lt;code&gt;global&lt;/code&gt; and &lt;code&gt;nonlocal&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;What &lt;strong&gt;scope-related tools&lt;/strong&gt; Python offers and how you can use them&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With this knowledge at hand, you can take advantage of Python scopes to write more reliable and maintainable programs. Using Python scope will help you avoid or minimize bugs related to name collision as well as bad use of global names across your programs.&lt;/p&gt;
&lt;p&gt;You’ll get the most out of this tutorial if you’re familiar with intermediate Python concepts like &lt;a href=&quot;https://realpython.com/courses/intro-object-oriented-programming-oop-python/&quot;&gt;classes&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/defining-your-own-python-function/&quot;&gt;functions&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/inner-functions-what-are-they-good-for/#closures-and-factory-functions&quot;&gt;inner functions&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/courses/variables-python/&quot;&gt;variables&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/courses/introduction-python-exceptions/&quot;&gt;exceptions&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/courses/using-list-comprehensions-effectively/&quot;&gt;comprehensions&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/lessons/operators-and-built-functions/&quot;&gt;built-in functions&lt;/a&gt;, and standard data structures.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Free Bonus:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-mastery-course/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-mastery-course&quot; data-focus=&quot;false&quot;&gt;5 Thoughts On Python Mastery&lt;/a&gt;, a free course for Python developers that shows you the roadmap and the mindset you&#39;ll need to take your Python skills to the next level.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;understanding-scope&quot;&gt;Understanding Scope&lt;/h2&gt;
&lt;p&gt;In programming, the &lt;strong&gt;scope&lt;/strong&gt; of a name defines the area of a program in which you can unambiguously access that name, such as variables, functions, objects, and so on. A name will only be visible to and accessible by the code in its scope. Several programming languages take advantage of scope for avoiding name collisions and unpredictable behaviors. Most commonly, you’ll distinguish two general scopes:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Global scope:&lt;/strong&gt; The names that you define in this scope are available to all your code.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Local scope:&lt;/strong&gt; The names that you define in this scope are only available or visible to the code within the scope.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Scope came about because early programming languages (like BASIC) only had &lt;strong&gt;global names&lt;/strong&gt;. With this kind of name, any part of the program could modify any variable at any time, so maintaining and debugging large programs could become a real nightmare. To work with global names, you’d need to keep all the code in mind at the same time to know what the value of a given name is at any time. This was an important side-effect of not having scopes.&lt;/p&gt;
&lt;p&gt;Some languages like Python use &lt;strong&gt;scope&lt;/strong&gt; to avoid this kind of problem. When you use a language that implements scope, there’s no way for you to access all the variables in a program at all locations in that program. In this case, your ability to access a given name will depend on where you’ve defined that name.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; You’ll be using the term &lt;strong&gt;name&lt;/strong&gt; to refer to the identifiers of variables, constants, functions, classes, or any other object that can be assigned a name.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;The names in your programs will have the scope of the block of code in which you define them. When you can access the value of a given name from someplace in your code, you’ll say that the name is &lt;strong&gt;in scope&lt;/strong&gt;. If you can’t access the name, then you’ll say that the name is &lt;strong&gt;out of scope&lt;/strong&gt;.&lt;/p&gt;
&lt;h3 id=&quot;names-and-scopes-in-python&quot;&gt;Names and Scopes in Python&lt;/h3&gt;
&lt;p&gt;Since Python is a &lt;a href=&quot;https://wiki.python.org/moin/Why%20is%20Python%20a%20dynamic%20language%20and%20also%20a%20strongly%20typed%20language&quot;&gt;dynamically-typed&lt;/a&gt; language, variables in Python come into existence when you first assign them a value. On the other hand, functions and classes are available after you define them using &lt;a href=&quot;https://docs.python.org/3/reference/compound_stmts.html#def&quot;&gt;&lt;code&gt;def&lt;/code&gt;&lt;/a&gt; or &lt;a href=&quot;https://docs.python.org/3/reference/compound_stmts.html#class-definitions&quot;&gt;&lt;code&gt;class&lt;/code&gt;&lt;/a&gt;, respectively. Finally, &lt;a href=&quot;https://docs.python.org/3/glossary.html#term-module&quot;&gt;modules&lt;/a&gt; exist after you import them. As a summary, you can create Python names through one of the following operations:&lt;/p&gt;
&lt;div class=&quot;table-responsive&quot;&gt;
&lt;table class=&quot;table table-hover&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Operation&lt;/th&gt;
&lt;th&gt;Statement&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://docs.python.org/3/reference/simple_stmts.html#assignment-statements&quot;&gt;Assignments&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;x = value&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://realpython.com/courses/python-imports-101/&quot;&gt;Import operations&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;import module&lt;/code&gt; or &lt;code&gt;from module import name&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Function definitions&lt;/td&gt;
&lt;td&gt;&lt;code&gt;def my_func(): ...&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Argument definitions in the context of functions&lt;/td&gt;
&lt;td&gt;&lt;code&gt;def my_func(arg1, arg2,... argN): ...&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Class definitions&lt;/td&gt;
&lt;td&gt;&lt;code&gt;class MyClass: ...&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;All these operations create or, in the case of assignments, update new Python names because all of them assign a name to a variable, constant, function, class, instance, module, or other Python object.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; There’s an important difference between &lt;strong&gt;assignment operations&lt;/strong&gt; and &lt;strong&gt;reference or access operations&lt;/strong&gt;. When you reference a name, you’re just retrieving its content or value. When you assign a name, you’re either creating that name or modifying it.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Python uses the location of the name assignment or definition to associate it with a particular scope. In other words, where you assign or define a name in your code determines the scope or visibility of that name.&lt;/p&gt;
&lt;p&gt;For example, if you assign a value to a name inside a function, then that name will have a &lt;strong&gt;local Python scope&lt;/strong&gt;. In contrast, if you assign a value to a name outside of all functions—say, at the top level of a module—then that name will have a &lt;strong&gt;global Python scope&lt;/strong&gt;.&lt;/p&gt;
&lt;h3 id=&quot;python-scope-vs-namespace&quot;&gt;Python Scope vs Namespace&lt;/h3&gt;
&lt;p&gt;In Python, the concept of scope is closely related to the concept of the &lt;a href=&quot;https://docs.python.org/3/glossary.html#term-namespace&quot;&gt;namespace&lt;/a&gt;. As you’ve learned so far, a Python scope determines where in your program a name is visible. Python scopes are implemented as &lt;a href=&quot;https://realpython.com/python-dicts/&quot;&gt;dictionaries&lt;/a&gt; that map names to objects. These &lt;a href=&quot;https://realpython.com/courses/dictionaries-python/&quot;&gt;dictionaries&lt;/a&gt; are commonly called &lt;strong&gt;namespaces&lt;/strong&gt;. These are the concrete mechanisms that Python uses to store names. They’re stored in a special attribute called &lt;a href=&quot;https://docs.python.org/3/library/stdtypes.html#object.__dict__&quot;&gt;&lt;code&gt;.__dict__&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Names at the top level of a module are stored in the module’s namespace. In other words, they’re stored in the module’s &lt;code&gt;.__dict__&lt;/code&gt; attribute. Take a look at the following code:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;span class=&quot;repl-toggle&quot; title=&quot;Toggle REPL prompts and output&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;sys&lt;/span&gt;
&lt;span class=&quot;hll&quot;&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sys&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;vm&quot;&gt;__dict__&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;keys&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;go&quot;&gt;dict_keys([&#39;__name__&#39;, &#39;__doc__&#39;, &#39;__package__&#39;,..., &#39;argv&#39;, &#39;ps1&#39;, &#39;ps2&#39;])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-scope-legb-rule/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-scope-legb-rule/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Make a 2D Side-Scroller Game With PyGame</title>
      <id>https://realpython.com/courses/pygame-primer/</id>
      <link href="https://realpython.com/courses/pygame-primer/"/>
      <updated>2020-03-17T14:00:00+00:00</updated>
      <summary>In this step-by-step course, you&#39;ll learn how to use PyGame. This library allows you to create games and rich multimedia programs in Python. You&#39;ll learn how to draw items on your screen, implement collision detection, handle user input, and much more!</summary>
      <content type="html">
        &lt;p&gt;In this course, you&amp;rsquo;ll learn about creating games using Python and the library &lt;strong&gt;PyGame&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this course, you&amp;rsquo;ll be able to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Draw items on your screen&lt;/li&gt;
&lt;li&gt;Play sound effects and music&lt;/li&gt;
&lt;li&gt;Handle user input&lt;/li&gt;
&lt;li&gt;Implement event loops&lt;/li&gt;
&lt;li&gt;Describe how game programming differs from standard procedural Python programming&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This primer assumes you have a &lt;a href=&quot;https://realpython.com/learning-paths/python3-introduction/&quot;&gt;basic understanding of writing Python programs&lt;/a&gt;, including user-defined functions, &lt;a href=&quot;https://realpython.com/courses/python-imports-101/&quot;&gt;imports&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/courses/mastering-while-loops/&quot;&gt;loops&lt;/a&gt;, and &lt;a href=&quot;https://realpython.com/courses/python-conditional-statements/&quot;&gt;conditionals&lt;/a&gt;. You should also be familiar with &lt;a href=&quot;https://realpython.com/read-write-files-python/&quot;&gt;how to open files&lt;/a&gt; on your platform. A &lt;a href=&quot;https://realpython.com/learning-paths/object-oriented-programming-oop-python/&quot;&gt;basic understanding of object-oriented Python&lt;/a&gt; is helpful as well. &lt;code&gt;pygame&lt;/code&gt; works with most versions of Python, but Python 3.6 is recommended and used throughout this article.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>How to Do a Binary Search in Python</title>
      <id>https://realpython.com/binary-search-python/</id>
      <link href="https://realpython.com/binary-search-python/"/>
      <updated>2020-03-16T14:00:00+00:00</updated>
      <summary>Binary search is a classic algorithm in computer science. In this step-by-step tutorial, you&#39;ll learn how to implement this algorithm in Python. You&#39;ll learn how to leverage existing libraries as well as craft your own binary search Python implementation.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;&lt;strong&gt;Binary search&lt;/strong&gt; is a classic algorithm in computer science. It often comes up in programming contests and &lt;a href=&quot;https://realpython.com/python-coding-interview-tips/&quot;&gt;technical interviews&lt;/a&gt;. Implementing binary search turns out to be a challenging task, even when you understand the concept. Unless you’re curious or have a specific assignment, you should always leverage existing libraries to do a binary search in Python or any other language.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll learn how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use the &lt;strong&gt;&lt;code&gt;bisect&lt;/code&gt;&lt;/strong&gt; module to do a binary search in Python&lt;/li&gt;
&lt;li&gt;Implement a binary search in Python both &lt;strong&gt;recursively&lt;/strong&gt; and &lt;strong&gt;iteratively&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Recognize and fix &lt;strong&gt;defects&lt;/strong&gt; in a binary search Python implementation&lt;/li&gt;
&lt;li&gt;Analyze the &lt;strong&gt;time-space complexity&lt;/strong&gt; of the binary search algorithm&lt;/li&gt;
&lt;li&gt;Search even &lt;strong&gt;faster&lt;/strong&gt; than binary search&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This tutorial assumes you’re a student or an &lt;a href=&quot;https://realpython.com/tutorials/intermediate/&quot;&gt;&lt;strong&gt;intermediate programmer&lt;/strong&gt;&lt;/a&gt; with an interest in algorithms and data structures. At the very least, you should be familiar with Python’s built-in data types, such as &lt;a href=&quot;https://realpython.com/python-lists-tuples/&quot;&gt;lists and tuples&lt;/a&gt;. In addition, some familiarity with &lt;a href=&quot;https://realpython.com/python-thinking-recursively/&quot;&gt;recursion&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/lessons/classes-python/&quot;&gt;classes&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-data-classes/&quot;&gt;data classes&lt;/a&gt;, and &lt;a href=&quot;https://realpython.com/python-lambda/&quot;&gt;lambdas&lt;/a&gt; will help you better understand the concepts you’ll see in this tutorial.&lt;/p&gt;
&lt;p&gt;Below you’ll find a link to the sample code you’ll see throughout this tutorial, which requires Python 3.7 or later to run:&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Get Sample Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/binary-search-python-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-binary-search-python-code&quot; data-focus=&quot;false&quot;&gt;Click here to get the sample code you&#39;ll use&lt;/a&gt; to learn about binary search in Python in this tutorial.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;benchmarking&quot;&gt;Benchmarking&lt;/h2&gt;
&lt;p&gt;In the next section of this tutorial, you’ll be using a subset of the &lt;a href=&quot;https://www.imdb.com/&quot;&gt;Internet Movie Database (IMDb)&lt;/a&gt; to benchmark the performance of a few search algorithms. This dataset is free of charge for personal and non-commercial use. It’s distributed as a bunch of compressed &lt;a href=&quot;https://en.wikipedia.org/wiki/Tab-separated_values&quot;&gt;tab-separated values (TSV)&lt;/a&gt; files, which get daily updates.&lt;/p&gt;
&lt;p&gt;To make your life easier, you can use a Python script included in the sample code. It’ll automatically fetch the relevant file from IMDb, decompress it, and extract the interesting pieces:&lt;/p&gt;
&lt;div class=&quot;highlight sh&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; python download_imdb.py
&lt;span class=&quot;go&quot;&gt;Fetching data from IMDb...&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Created &quot;names.txt&quot; and &quot;sorted_names.txt&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Be warned that this will download and extract approximately 600 MB of data, as well as produce two additional files, which are about half of that in size. The download, as well as the processing of this data, might take a minute or two to complete.&lt;/p&gt;
&lt;h3 id=&quot;download-imdb&quot;&gt;Download IMDb&lt;/h3&gt;
&lt;p&gt;To manually obtain the data, navigate your web browser to &lt;a href=&quot;https://datasets.imdbws.com/&quot;&gt;https://datasets.imdbws.com/&lt;/a&gt; and grab the file called &lt;code&gt;name.basics.tsv.gz&lt;/code&gt;, which contains the records of actors, directors, writers, and so on. When you decompress the file, you’ll see the following content:&lt;/p&gt;
&lt;div class=&quot;highlight text&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;nconst     primaryName      birthYear  deathYear  (...)
nm0000001  Fred Astaire     1899       1987       (...)
nm0000002  Lauren Bacall    1924       2014       (...)
nm0000003  Brigitte Bardot  1934       \N         (...)
nm0000004  John Belushi     1949       1982       (...)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;It has a &lt;strong&gt;header&lt;/strong&gt; with the column names in the first line, followed by &lt;strong&gt;data records&lt;/strong&gt; in each of the subsequent lines. Each record contains a unique identifier, a full name, birth year, and a few other attributes. These are all delimited with a tab character.&lt;/p&gt;
&lt;p&gt;There are millions of records, so don’t try to open the file with a regular text editor to avoid crashing your computer. Even specialized software such as spreadsheets can have problems opening it. Instead, you might take advantage of the high-performance data grid viewer included in &lt;a href=&quot;https://jupyterlab.readthedocs.io/en/stable/&quot;&gt;JupyterLab&lt;/a&gt;, for example.&lt;/p&gt;
&lt;h3 id=&quot;read-tab-separated-values&quot;&gt;Read Tab-Separated Values&lt;/h3&gt;
&lt;p&gt;There are a few ways to parse a TSV file. For example, you can read it with &lt;a href=&quot;https://realpython.com/lessons/reading-csvs-pandas/&quot;&gt;Pandas&lt;/a&gt;, use a dedicated application, or leverage a few command-line tools. However, it’s recommended that you use the hassle-free Python script included in the sample code.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; As a rule of thumb, you should avoid parsing files manually because you might overlook &lt;strong&gt;edge cases&lt;/strong&gt;. For example, in one of the fields, the delimiting tab character could be used literally inside quotation marks, which would break the number of columns. Whenever possible, try to find a relevant module in the standard library or a trustworthy third-party one.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Ultimately, you want to end up with two text files at your disposal:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;names.txt&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;sorted_names.txt&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;One will contain a &lt;a href=&quot;https://realpython.com/courses/lists-tuples-python/&quot;&gt;list&lt;/a&gt; of names obtained by cutting out the second column from the original TSV file:&lt;/p&gt;
&lt;div class=&quot;highlight text&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;Fred Astaire
Lauren Bacall
Brigitte Bardot
John Belushi
Ingmar Bergman
...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The second one will be the sorted version of this.&lt;/p&gt;
&lt;p&gt;Once both files are ready, you can load them into Python using this function:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/binary-search-python/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/binary-search-python/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Defining Main Functions in Python</title>
      <id>https://realpython.com/courses/python-main-function/</id>
      <link href="https://realpython.com/courses/python-main-function/"/>
      <updated>2020-03-10T14:00:00+00:00</updated>
      <summary>In this step-by-step course, you&#39;ll learn how Python main functions are used and some best practices to organize your code so it can be executed as a script and imported from another module.</summary>
      <content type="html">
        &lt;p&gt;Many programming languages have a special function that is automatically executed when an operating system starts to run a program. This function is usually called &lt;strong&gt;&lt;code&gt;main()&lt;/code&gt;&lt;/strong&gt; and must have a specific return type and arguments according to the language standard. On the other hand, the Python interpreter executes scripts starting at the top of the file, and there is no specific function that Python automatically executes.&lt;/p&gt;
&lt;p&gt;Nevertheless, having a defined starting point for the execution of a program is useful for understanding how a program works. Python programmers have come up with several conventions to define this starting point.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this course, you&amp;rsquo;ll understand:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What the special &lt;code&gt;__name__&lt;/code&gt; variable is and how Python defines it&lt;/li&gt;
&lt;li&gt;Why you would want to use a &lt;code&gt;main()&lt;/code&gt; in Python&lt;/li&gt;
&lt;li&gt;What conventions there are for defining &lt;code&gt;main()&lt;/code&gt; in Python &lt;/li&gt;
&lt;li&gt;What the best practices are for what code to put into your &lt;code&gt;main()&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #0: About the Show</title>
      <id>https://realpython.com/podcasts/rpp/0/</id>
      <link href="https://realpython.com/podcasts/rpp/0/"/>
      <updated>2020-03-06T00:00:00+00:00</updated>
      <summary>A weekly Python podcast hosted by Christopher Bailey with interviews, coding tips, and conversation with guests from the Python community.

The show covers a wide range of topics including Python programming best practices, career tips, and related software development topics.

Join us to hear what&#39;s new in the world of Python programming and become a better coder.</summary>
      <content type="html">
        &lt;p&gt;A weekly Python podcast hosted by Christopher Bailey with interviews, coding tips, and conversation with guests from the Python community.

The show covers a wide range of topics including Python programming best practices, career tips, and related software development topics.

Join us to hear what&#39;s new in the world of Python programming and become a better coder.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>How to Implement a Python Stack</title>
      <id>https://realpython.com/courses/python-stack/</id>
      <link href="https://realpython.com/courses/python-stack/"/>
      <updated>2020-03-03T14:00:00+00:00</updated>
      <summary>In this course, you&#39;ll learn how to implement a Python stack. You&#39;ll see how to recognize when a stack is a good choice for data structures, how to decide which implementation is best for a program, and what extra considerations to make about stacks in a threading or multiprocessing environment.</summary>
      <content type="html">
        &lt;p&gt;Have you heard of &lt;strong&gt;stacks&lt;/strong&gt; and wondered what they are? Do you have a general idea but are wondering how to implement a Python stack? You&amp;rsquo;ve come to the right place!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How to recognize when a stack is a good choice for a &lt;strong&gt;data structure&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to decide which &lt;strong&gt;implementation&lt;/strong&gt; is best for your program&lt;/li&gt;
&lt;li&gt;What extra considerations to make about stacks in a &lt;strong&gt;threading or multiprocessing&lt;/strong&gt; environment&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This course is for Pythonistas who are comfortable &lt;a href=&quot;https://realpython.com/quizzes/run-python-scripts/&quot;&gt;running scripts&lt;/a&gt;, know what a &lt;a href=&quot;https://realpython.com/python-lists-tuples/&quot;&gt;&lt;code&gt;list&lt;/code&gt;&lt;/a&gt; is and how to use it, and are wondering how to implement Python stacks.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>How to Work With a PDF in Python</title>
      <id>https://realpython.com/courses/pdf-python/</id>
      <link href="https://realpython.com/courses/pdf-python/"/>
      <updated>2020-02-25T14:00:00+00:00</updated>
      <summary>In this step-by-step course, you&#39;ll learn how to work with a PDF in Python. You&#39;ll see how to extract metadata from preexisting PDFs. You&#39;ll also learn how to merge, split, watermark, and rotate pages in PDFs using Python and PyPDF2.</summary>
      <content type="html">
        &lt;p&gt;The &lt;strong&gt;Portable Document Format&lt;/strong&gt; or &lt;strong&gt;PDF&lt;/strong&gt; is a file format that can be used to present and exchange documents reliably across operating systems. While the PDF was originally invented by Adobe, it is now an &lt;a href=&quot;https://www.iso.org/standard/51502.html&quot;&gt;open standard&lt;/a&gt; that is maintained by the International Organization for Standardization (ISO). You can work with a preexisting PDF in Python by using the &lt;strong&gt;&lt;code&gt;PyPDF2&lt;/code&gt;&lt;/strong&gt; package.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;PyPDF2&lt;/code&gt; is a &lt;a href=&quot;https://stackoverflow.com/questions/45976946/what-is-pure-python&quot;&gt;pure-Python&lt;/a&gt; package that you can use for many different types of PDF operations.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this course, you&amp;rsquo;ll know how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Extract document information from a PDF in Python&lt;/li&gt;
&lt;li&gt;Rotate pages&lt;/li&gt;
&lt;li&gt;Merge PDFs&lt;/li&gt;
&lt;li&gt;Split PDFs&lt;/li&gt;
&lt;li&gt;Add watermarks&lt;/li&gt;
&lt;li&gt;Encrypt a PDF&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Finding the Perfect Python Code Editor</title>
      <id>https://realpython.com/courses/finding-perfect-python-code-editor/</id>
      <link href="https://realpython.com/courses/finding-perfect-python-code-editor/"/>
      <updated>2020-02-18T14:00:00+00:00</updated>
      <summary>Find your perfect Python development setup with this review of Python IDEs and code editors. Writing Python using IDLE or the Python REPL is great for simple things, but not ideal for larger programming projects. With this course you&#39;ll get an overview of the most common Python coding environments to help you make an informed decision.</summary>
      <content type="html">
        &lt;p&gt;Find your perfect Python development setup with this review of &lt;strong&gt;Python IDEs&lt;/strong&gt; and &lt;strong&gt;code editors&lt;/strong&gt;. Writing Python using IDLE or the Python REPL is great for simple things, but not ideal for larger programming projects. With this course you&amp;rsquo;ll get an overview of the most common Python coding environments to help you make an informed decision.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this course, you&amp;rsquo;ll know how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Choose the Python editing environment that&amp;rsquo;s right for you&lt;/li&gt;
&lt;li&gt;Perform common tasks like creating, running, and debugging code&lt;/li&gt;
&lt;li&gt;Dig deeper into optimizing your favorite editing setup&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Playing and Recording Sound in Python</title>
      <id>https://realpython.com/courses/playing-and-recording-sound-python/</id>
      <link href="https://realpython.com/courses/playing-and-recording-sound-python/"/>
      <updated>2020-02-11T14:00:00+00:00</updated>
      <summary>In this course, you&#39;ll learn about libraries that can be used for playing and recording sound in Python, such as PyAudio and python-sounddevice. You&#39;ll also see code snippets for playing and recording sound files and arrays, as well as for converting between different sound file formats.</summary>
      <content type="html">
        &lt;p&gt;In this course, you&amp;rsquo;ll learn how to play and record &lt;strong&gt;sound&lt;/strong&gt; in &lt;strong&gt;Python&lt;/strong&gt; using some of the most popular audio libraries. You&amp;rsquo;ll learn about the most straightforward methods for playing and recording sound first, and then you&amp;rsquo;ll learn about some libraries that offer some more functionality in exchange for a few extra lines of code.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this course, you&amp;rsquo;ll know how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Play MP3 and WAV files, as well as a range of other audio formats&lt;/li&gt;
&lt;li&gt;Play NumPy and Python arrays containing sound&lt;/li&gt;
&lt;li&gt;Record sound using Python&lt;/li&gt;
&lt;li&gt;Save your recordings or audio files in a range of different file formats&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  

</feed>
