<?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>2021-07-27T14:00:00+00:00</updated>
  <id>https://realpython.com/</id>
  <author>
    <name>Real Python</name>
  </author>

  
    <entry>
      <title>The Pandas DataFrame: Working With Data Efficiently</title>
      <id>https://realpython.com/courses/pandas-dataframe-working-with-data/</id>
      <link href="https://realpython.com/courses/pandas-dataframe-working-with-data/"/>
      <updated>2021-07-27T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll get started with Pandas DataFrames, which are powerful and widely used two-dimensional data structures. You&#x27;ll learn how to perform basic operations with data, handle missing values, work with time-series data, and visualize data from a Pandas DataFrame.</summary>
      <content type="html">
        &lt;p&gt;The &lt;a href=&quot;https://pandas.pydata.org/pandas-docs/stable/reference/frame.html&quot;&gt;Pandas DataFrame&lt;/a&gt; is a &lt;a href=&quot;https://pandas.pydata.org/pandas-docs/stable/user_guide/dsintro.html&quot;&gt;structure&lt;/a&gt; that contains &lt;strong&gt;two-dimensional data&lt;/strong&gt; and its corresponding &lt;strong&gt;labels&lt;/strong&gt;. DataFrames are widely used in &lt;a href=&quot;https://realpython.com/tutorials/data-science/&quot;&gt;data science&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/tutorials/machine-learning/&quot;&gt;machine learning&lt;/a&gt;, scientific computing, and many other data-intensive fields.&lt;/p&gt;
&lt;p&gt;DataFrames are similar to &lt;a href=&quot;https://realpython.com/python-sql-libraries/&quot;&gt;SQL tables&lt;/a&gt; or the spreadsheets that you work with in Excel or Calc. In many cases, DataFrames are faster, easier to use, and more powerful than tables or spreadsheets because they&amp;rsquo;re an integral part of the &lt;a href=&quot;https://www.python.org/about/&quot;&gt;Python&lt;/a&gt; and &lt;a href=&quot;https://numpy.org/#&quot;&gt;NumPy&lt;/a&gt; ecosystems.&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 a &lt;strong&gt;Pandas DataFrame&lt;/strong&gt; is and how to create one&lt;/li&gt;
&lt;li&gt;How to &lt;strong&gt;access, modify, add, sort, filter, and delete&lt;/strong&gt; data&lt;/li&gt;
&lt;li&gt;How to handle &lt;strong&gt;missing values&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to work with &lt;strong&gt;time-series data&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to quickly &lt;strong&gt;visualize&lt;/strong&gt; data&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>Python&#x27;s collections: A Buffet of Specialized Data Types</title>
      <id>https://realpython.com/python-collections-module/</id>
      <link href="https://realpython.com/python-collections-module/"/>
      <updated>2021-07-26T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn all about the series of specialized container data types in the collections module from the Python standard library.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Python’s &lt;a href=&quot;https://docs.python.org/3/library/collections.html#module-collections&quot;&gt;&lt;code&gt;collections&lt;/code&gt;&lt;/a&gt; module provides a rich set of &lt;strong&gt;specialized container data types&lt;/strong&gt; carefully designed to approach specific programming problems in a Pythonic and efficient way. The module also provides wrapper classes that make it safer to create custom classes that behave similar to the built-in types &lt;code&gt;dict&lt;/code&gt;, &lt;code&gt;list&lt;/code&gt;, and &lt;code&gt;str&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Learning about the data types and classes in &lt;code&gt;collections&lt;/code&gt; will allow you to grow your programming tool kit with a valuable set of reliable and efficient tools.&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;Write &lt;strong&gt;readable&lt;/strong&gt; and &lt;strong&gt;explicit&lt;/strong&gt; code with &lt;code&gt;namedtuple&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Build &lt;strong&gt;efficient queues and stacks&lt;/strong&gt; with &lt;code&gt;deque&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Count&lt;/strong&gt; objects quickly with &lt;code&gt;Counter&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Handle &lt;strong&gt;missing dictionary keys&lt;/strong&gt; with &lt;code&gt;defaultdict&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Guarantee the &lt;strong&gt;insertion order&lt;/strong&gt; of keys with &lt;code&gt;OrderedDict&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Manage &lt;strong&gt;multiple dictionaries&lt;/strong&gt; as a single unit with &lt;code&gt;ChainMap&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To better understand the data types and classes in &lt;code&gt;collections&lt;/code&gt;, you should know the basics of working with Python’s built-in data types, such as &lt;a href=&quot;https://realpython.com/python-lists-tuples/&quot;&gt;lists, tuples&lt;/a&gt;, and &lt;a href=&quot;https://realpython.com/python-dicts/&quot;&gt;dictionaries&lt;/a&gt;. Additionally, the last part of the article requires some basic knowledge about &lt;a href=&quot;https://realpython.com/python3-object-oriented-programming/&quot;&gt;object-oriented programming&lt;/a&gt; in Python.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&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; markdown=&quot;1&quot;&gt;Get a sample chapter from Python Tricks: The Book&lt;/a&gt; that shows you Python’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-started-with-pythons-collections&quot;&gt;Getting Started With Python’s &lt;code&gt;collections&lt;/code&gt;&lt;a class=&quot;headerlink&quot; href=&quot;#getting-started-with-pythons-collections&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Back in &lt;a href=&quot;https://docs.python.org/3/whatsnew/2.4.html#new-improved-and-deprecated-modules&quot;&gt;Python 2.4&lt;/a&gt;, &lt;a href=&quot;https://twitter.com/raymondh&quot;&gt;Raymond Hettinger&lt;/a&gt; contributed a new module called &lt;a href=&quot;https://docs.python.org/3/library/collections.html#module-collections&quot;&gt;&lt;code&gt;collections&lt;/code&gt;&lt;/a&gt; to the &lt;a href=&quot;https://docs.python.org/3/library/index.html&quot;&gt;standard library&lt;/a&gt;. The goal was to provide various specialized collection data types to approach specific programming problems.&lt;/p&gt;
&lt;p&gt;At that time, &lt;code&gt;collections&lt;/code&gt; only included one data structure, &lt;strong&gt;&lt;code&gt;deque&lt;/code&gt;&lt;/strong&gt;, which was specially designed as a &lt;a href=&quot;https://en.wikipedia.org/wiki/Double-ended_queue&quot;&gt;double-ended queue&lt;/a&gt; that supports efficient &lt;strong&gt;append&lt;/strong&gt; and &lt;strong&gt;pop&lt;/strong&gt; operations on either end of the sequence. From this point on, several modules in the standard library took advantage of &lt;code&gt;deque&lt;/code&gt; to improve the performance of their classes and structures. Some outstanding examples are &lt;a href=&quot;https://docs.python.org/3/library/queue.html#module-queue&quot;&gt;&lt;code&gt;queue&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://docs.python.org/3/library/threading.html#module-threading&quot;&gt;&lt;code&gt;threading&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;With time, a handful of specialized container data types populated the module:&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;Data type&lt;/th&gt;
&lt;th&gt;Python version&lt;/th&gt;
&lt;th&gt;Description&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/library/collections.html#collections.deque&quot;&gt;&lt;code&gt;deque&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://docs.python.org/3/whatsnew/2.4.html#new-improved-and-deprecated-modules&quot;&gt;2.4&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;A sequence-like collection that supports efficient addition and removal of items from either end of the sequence&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://docs.python.org/3/library/collections.html#collections.defaultdict&quot;&gt;&lt;code&gt;defaultdict&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://docs.python.org/3/whatsnew/2.5.html#new-improved-and-removed-modules&quot;&gt;2.5&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;A dictionary subclass for constructing default values for missing keys and automatically adding them to the dictionary&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://docs.python.org/3/library/collections.html#collections.namedtuple&quot;&gt;&lt;code&gt;namedtuple()&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://docs.python.org/3/whatsnew/2.6.html#new-and-improved-modules&quot;&gt;2.6&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;A factory function for creating subclasses of &lt;code&gt;tuple&lt;/code&gt; that provides named fields that allow accessing items by name while keeping the ability to access items by index&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://docs.python.org/3/library/collections.html#collections.OrderedDict&quot;&gt;&lt;code&gt;OrderedDict&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://docs.python.org/3/whatsnew/2.7.html#new-and-improved-modules&quot;&gt;2.7&lt;/a&gt;, &lt;a href=&quot;https://docs.python.org/3/whatsnew/3.1.html#pep-372-ordered-dictionaries&quot;&gt;3.1&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;A dictionary subclass that keeps the key-value pairs ordered according to when the keys are inserted&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://docs.python.org/3/library/collections.html#collections.Counter&quot;&gt;&lt;code&gt;Counter&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://docs.python.org/3/whatsnew/2.7.html#new-and-improved-modules&quot;&gt;2.7&lt;/a&gt;, &lt;a href=&quot;https://docs.python.org/3/whatsnew/3.1.html#pep-372-ordered-dictionaries&quot;&gt;3.1&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;A dictionary subclass that supports convenient counting of unique items in a sequence or iterable&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://docs.python.org/3/library/collections.html#collections.ChainMap&quot;&gt;&lt;code&gt;ChainMap&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://docs.python.org/3/whatsnew/3.3.html#collections&quot;&gt;3.3&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;A dictionary-like class that allows treating a number of mappings as a single dictionary object&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;Besides these specialized data types, &lt;code&gt;collections&lt;/code&gt; also provides three base classes that facilitate the creations of custom lists, dictionaries, and &lt;a href=&quot;https://realpython.com/python-strings/&quot;&gt;strings&lt;/a&gt;:&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;Class&lt;/th&gt;
&lt;th&gt;Description&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/library/collections.html#collections.UserDict&quot;&gt;&lt;code&gt;UserDict&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;A wrapper class around a dictionary object that facilitates subclassing &lt;code&gt;dict&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://docs.python.org/3/library/collections.html#collections.UserList&quot;&gt;&lt;code&gt;UserList&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;A wrapper class around a list object that facilitates subclassing &lt;code&gt;list&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://docs.python.org/3/library/collections.html#collections.UserString&quot;&gt;&lt;code&gt;UserString&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;A wrapper class around a string object that facilitates subclassing &lt;code&gt;string&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;The need for these wrapper classes was partially eclipsed by the ability to subclass the corresponding standard built-in data types. However, sometimes using these classes is safer and less error-prone than using standard data types.&lt;/p&gt;
&lt;p&gt;With this brief introduction to &lt;code&gt;collections&lt;/code&gt; and the specific use cases that the data structures and classes in this module can solve, it’s time to take a closer look at them. Before that, it’s important to point out that this tutorial is an introduction to &lt;code&gt;collections&lt;/code&gt; as a whole. In most of the following sections, you’ll find a blue alert box that’ll guide you to a dedicated article on the class or function at hand.&lt;/p&gt;
&lt;h2 id=&quot;improving-code-readability-namedtuple&quot;&gt;Improving Code Readability: &lt;code&gt;namedtuple()&lt;/code&gt;&lt;a class=&quot;headerlink&quot; href=&quot;#improving-code-readability-namedtuple&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Python’s &lt;code&gt;namedtuple()&lt;/code&gt; is a &lt;a href=&quot;https://en.wikipedia.org/wiki/Factory_(object-oriented_programming)&quot;&gt;factory function&lt;/a&gt; that allows you to create &lt;code&gt;tuple&lt;/code&gt; subclasses with &lt;strong&gt;named fields&lt;/strong&gt;. These fields give you direct access to the values in a given named tuple using the &lt;strong&gt;dot notation&lt;/strong&gt;, like in &lt;code&gt;obj.attr&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The need for this feature arose because using indices to access the values in a regular tuple is annoying, difficult to read, and error-prone. This is especially true if the tuple you’re working with has several items and is constructed far away from where you’re using it.&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; Check out &lt;a href=&quot;https://realpython.com/python-namedtuple/&quot;&gt;Write Pythonic and Clean Code With namedtuple&lt;/a&gt; for a deeper dive into how to use &lt;code&gt;namedtuple&lt;/code&gt; in Python.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;A tuple subclass with named fields that developers can access with the dot notation seemed like a desirable feature back in Python 2.6. That’s the origin of &lt;code&gt;namedtuple()&lt;/code&gt;. The tuple subclasses you can build with this function are a big win in code readability if you compare them with regular tuples.&lt;/p&gt;
&lt;p&gt;To put the code readability problem in perspective, consider &lt;a href=&quot;https://docs.python.org/3/library/functions.html#divmod&quot;&gt;&lt;code&gt;divmod()&lt;/code&gt;&lt;/a&gt;. This built-in function takes two (non-complex) &lt;a href=&quot;https://realpython.com/python-numbers/&quot;&gt;numbers&lt;/a&gt; and returns a tuple with the &lt;strong&gt;quotient&lt;/strong&gt; and &lt;strong&gt;remainder&lt;/strong&gt; that result from the &lt;strong&gt;integer division&lt;/strong&gt; of the input values:&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;nb&quot;&gt;divmod&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;12&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;go&quot;&gt;(2, 2)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;It works nicely. However, is this result readable? Can you tell what the meaning of each number in the output is? Fortunately, Python offers a way to improve this. You can code a custom version of &lt;code&gt;divmod()&lt;/code&gt; with an explicit result using &lt;code&gt;namedtuple&lt;/code&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;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;collections&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;namedtuple&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;custom_divmod&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;DivMod&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;namedtuple&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;DivMod&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;quotient remainder&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;DivMod&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;divmod&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;...&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;custom_divmod&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;12&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;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;result&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;DivMod(quotient=2, remainder=2)&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;quotient&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;remainder&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now you know the meaning of each value in the result. You can also access each independent value using the dot notation and a descriptive field name.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-collections-module/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-collections-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 – Episode #70: What Can You Do With Python and Counting Objects Using &quot;Counter&quot;</title>
      <id>https://realpython.com/podcasts/rpp/70/</id>
      <link href="https://realpython.com/podcasts/rpp/70/"/>
      <updated>2021-07-23T12:00:00+00:00</updated>
      <summary>How is Python being used today, and what can you do with the language? Do you want to develop software, dive into data science and math, automate parts of your job and  digital life, or work with electronics? This week on the show, David Amos is back, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;How is Python being used today, and what can you do with the language? Do you want to develop software, dive into data science and math, automate parts of your job and  digital life, or work with electronics? This week on the show, David Amos is back, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.&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>Your First Steps With Django: Set Up a Django Project</title>
      <id>https://realpython.com/django-setup/</id>
      <link href="https://realpython.com/django-setup/"/>
      <updated>2021-07-21T14:05:12+00:00</updated>
      <summary>This tutorial provides a walkthrough and a reference for starting a Django project and app. You can use it as a quick setup guide for any future Django project and tutorial you&#x27;ll work on.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Before you can start to build the individual functionality of a new &lt;a href=&quot;https://www.djangoproject.com/&quot;&gt;Django&lt;/a&gt; web application, you always need to complete a couple of setup steps. This tutorial gives you a &lt;a href=&quot;#command-reference&quot;&gt;reference&lt;/a&gt; for the necessary steps to set up a Django project.&lt;/p&gt;
&lt;p&gt;The tutorial focuses on the initial steps you’ll need to take to start a new web application. To complete it, you’ll need to have &lt;a href=&quot;https://realpython.com/installing-python/&quot;&gt;Python installed&lt;/a&gt; and understand how to work with &lt;a href=&quot;https://realpython.com/python-virtual-environments-a-primer/&quot;&gt;virtual environments&lt;/a&gt; and Python’s package manager, &lt;a href=&quot;https://realpython.com/what-is-pip/&quot;&gt;&lt;code&gt;pip&lt;/code&gt;&lt;/a&gt;. While you won’t need much programming knowledge to complete this setup, you’ll need to &lt;a href=&quot;https://realpython.com/products/python-basics-book/&quot;&gt;know Python&lt;/a&gt; to do anything interesting with the resulting project scaffolding.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this tutorial, you’ll know how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Set up a &lt;strong&gt;virtual environment&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Install&lt;/strong&gt; Django&lt;/li&gt;
&lt;li&gt;Pin your project &lt;strong&gt;dependencies&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Set up a Django &lt;strong&gt;project&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Start a Django &lt;strong&gt;app&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Use this tutorial as your go-to reference until you’ve built so many projects that the necessary commands become second nature. Until then, follow the steps outlined below. There are also a few exercises throughout the tutorial to help reinforce what you’ve learned.&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;prepare-your-environment&quot;&gt;Prepare Your Environment&lt;a class=&quot;headerlink&quot; href=&quot;#prepare-your-environment&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;When you’re ready to start your new Django web application, create a new folder and navigate into it. In this folder, you’ll set up a new virtual environment using your command line:&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;python3 -m venv env
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This command sets up a new virtual environment named &lt;code&gt;env&lt;/code&gt; in your current working directory. Once the process is complete, you also need to activate the virtual environment:&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; env/bin/activate
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If the activation was successful, then you’ll see the name of your virtual environment, &lt;code&gt;(env)&lt;/code&gt;, at the beginning of your command prompt. This means that your environment setup is complete.&lt;/p&gt;
&lt;p&gt;You can learn more about how to &lt;a href=&quot;https://realpython.com/python-virtual-environments-a-primer/&quot;&gt;work with virtual environments in Python&lt;/a&gt;, and how to &lt;a href=&quot;https://realpython.com/learning-paths/perfect-your-python-development-setup/&quot;&gt;perfect your Python development setup&lt;/a&gt;, but for your Django setup, you have all you need. You can continue with installing the &lt;code&gt;django&lt;/code&gt; package.&lt;/p&gt;
&lt;h2 id=&quot;install-django-and-pin-your-dependencies&quot;&gt;Install Django and Pin Your Dependencies&lt;a class=&quot;headerlink&quot; href=&quot;#install-django-and-pin-your-dependencies&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Once you’ve created and activated your Python virtual environment, you can install Django into this dedicated development workspace:&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 gp-VirtualEnv&quot;&gt;(env)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python -m pip install django
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This command fetches the &lt;code&gt;django&lt;/code&gt; package from the &lt;a href=&quot;https://realpython.com/pypi-publish-python-package/&quot;&gt;Python Package Index (PyPI)&lt;/a&gt; using &lt;code&gt;pip&lt;/code&gt;. After the installation has completed, you can &lt;strong&gt;pin&lt;/strong&gt; your dependencies to make sure that you’re keeping track of which Django version you installed:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/django-setup/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/django-setup/ »&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>Speech Recognition With Python</title>
      <id>https://realpython.com/courses/speech-recognition-python/</id>
      <link href="https://realpython.com/courses/speech-recognition-python/"/>
      <updated>2021-07-20T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll cover the fundamentals of speech recognition with Python. You&#x27;ll learn which speech recognition library gives the best results and build a full-featured &quot;Guess The Word&quot; game with it.</summary>
      <content type="html">
        &lt;p&gt;Have you ever wondered how to add speech recognition to your Python project? It&amp;rsquo;s more straightforward than you might think. In this course, you&amp;rsquo;ll find out how.&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 &lt;strong&gt;speech recognition&lt;/strong&gt; works&lt;/li&gt;
&lt;li&gt;What speech recognition &lt;strong&gt;packages&lt;/strong&gt; are available on PyPI&lt;/li&gt;
&lt;li&gt;How to install and use the &lt;strong&gt;SpeechRecognition package&lt;/strong&gt;&amp;mdash;a full-featured and straightforward Python speech recognition library&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>Python Community Interview With Dustin Ingram</title>
      <id>https://realpython.com/interview-dustin-ingram/</id>
      <link href="https://realpython.com/interview-dustin-ingram/"/>
      <updated>2021-07-19T14:00:00+00:00</updated>
      <summary>Today I&#x27;m joined by Dustin Ingram, a developer advocate at Google, a director of the PSF, and a maintainer of PyPI. In this interview, we discuss how Google&#x27;s use of Python might differ from your own, maintaining PyPI, his love of PyCons and cooking, and more.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Today I’m joined by &lt;a href=&quot;https://dustingram.com/&quot;&gt;Dustin Ingram&lt;/a&gt;, a developer advocate at Google focused on supporting the Python community on Google Cloud. He is also a director of the Python Software Foundation (PSF) and a maintainer of PyPI. In this interview, we discuss how Google’s use of Python might differ from your own, what it takes to maintain PyPI, his goals as a PSF director, his love of PyCons, and more.&lt;/p&gt;
&lt;p class=&quot;mt-5&quot;&gt;&lt;strong&gt;Ricky:&lt;/strong&gt; &lt;em&gt;Thanks for joining me, Dustin. I’d like to start with my usual questions: how did you get into programming, and when did you start using Python?&lt;/em&gt; &lt;/p&gt;
&lt;figure&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid w-25 float-right ml-3 rounded-circle&quot; src=&quot;https://files.realpython.com/media/294415.6f9dda6ea484.png&quot; width=&quot;400&quot; height=&quot;400&quot; srcset=&quot;https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/294415.6f9dda6ea484.png&amp;amp;w=100&amp;amp;sig=d9ae770bcb01e12278009fe5d5f6165c165b3ee9 100w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/294415.6f9dda6ea484.png&amp;amp;w=200&amp;amp;sig=ec0417cc938e48896c9746d14556213143508091 200w, https://files.realpython.com/media/294415.6f9dda6ea484.png 400w&quot; sizes=&quot;75vw&quot; alt=&quot;Dustin Ingram Headshot&quot; data-asset=&quot;3765&quot;&gt;&lt;/figure&gt;

&lt;p&gt;&lt;strong&gt;Dustin:&lt;/strong&gt; Thanks for having me!&lt;/p&gt;
&lt;p&gt;I like to say that my first programming experience was when someone decided it was allowed—if not encouraged—for me to carry around a TI-83 calculator throughout high school. I spent far less time in geometry class learning geometry and far more time writing text-based games in &lt;a href=&quot;https://en.wikipedia.org/wiki/BASIC&quot;&gt;BASIC&lt;/a&gt; and, later, programs that would do my physics homework for me. &lt;/p&gt;
&lt;p&gt;I even released my first open source program: a little animation that made your calculator screen look like the flowing, garbled characters in &lt;em&gt;The Matrix&lt;/em&gt; (which I was obsessed with) and &lt;a href=&quot;https://www.ticalc.org/archives/files/fileinfo/296/29640.html&quot;&gt;published it&lt;/a&gt; to Texas Instruments’ third-party software repository.&lt;/p&gt;
&lt;p&gt;But my first actual exposure to programming was probably when I was first introduced to &lt;a href=&quot;https://en.wikipedia.org/wiki/Logo_(programming_language)&quot;&gt;Logo&lt;/a&gt;, the graphical programming language with the turtle as a cursor. I think it was elementary school, and the task was to try and reproduce some simple shapes, but I distinctly remember being blown away by the endless possibilities. I wasn’t confined to a predetermined path like a lot of the point-and-click computer games I had played before—I could make that turtle do anything.&lt;/p&gt;
&lt;p&gt;My dad is a tool designer, and when I was in high school, he ran a machine shop. The shop had a lot of the classic metalworking tools: lathes and milling machines that were operated mostly by hand. But they also had some newer computer numerical control (CNC) machines that were programmed with a language called &lt;a href=&quot;https://en.wikipedia.org/wiki/G-code&quot;&gt;G-code&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;If you’ve never seen G-code before, the best I can describe it is as a mashup of BASIC and Logo, but instead of a cute little turtle moving around, you have a drill bit spinning at several thousand rotations per minute attached to a half-ton machine. All the oldheads who were used to operating the classic, manual machines couldn’t quite wrap their head around this new technology, but it made total sense to me!&lt;/p&gt;
&lt;p&gt;Later in high school, I took some computer science classes that taught me some Java and convinced me that the field was worth pursuing. I went to college for computer science and encountered &lt;a href=&quot;https://en.wikipedia.org/wiki/Scheme_(programming_language)&quot;&gt;Scheme&lt;/a&gt; and other &lt;a href=&quot;https://en.wikipedia.org/wiki/Lisp_(programming_language)&quot;&gt;Lisps&lt;/a&gt;, some C and C++, but mostly more Java. &lt;/p&gt;
&lt;p&gt;Around that time, I started working at a research lab for the university, and while that was all Java too, some of the older, wiser grad students there were really into this new language called Python and were basically trying to sneak it into as many of their projects as they could. Once I was exposed to it, I was hooked too and started trying to write as much of it as I could.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/interview-dustin-ingram/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/interview-dustin-ingram/ »&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 #69: Planning a Faster Future at the Python Language Summit</title>
      <id>https://realpython.com/podcasts/rpp/69/</id>
      <link href="https://realpython.com/podcasts/rpp/69/"/>
      <updated>2021-07-16T12:00:00+00:00</updated>
      <summary>Do you wonder what the future may hold for the Python language? Are there speed improvements coming soon? What if you could be in the room while the core developers discuss Python&#x27;s future? This week on the show, we have Joanna Jablonski, who was invited to the Python Language Summit 2021 as a journalist to summarize and document the event.</summary>
      <content type="html">
        &lt;p&gt;Do you wonder what the future may hold for the Python language? Are there speed improvements coming soon? What if you could be in the room while the core developers discuss Python&#x27;s future? This week on the show, we have Joanna Jablonski, who was invited to the Python Language Summit 2021 as a journalist to summarize and document the event.&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>Using FastAPI to Build Python Web APIs</title>
      <id>https://realpython.com/fastapi-python-web-apis/</id>
      <link href="https://realpython.com/fastapi-python-web-apis/"/>
      <updated>2021-07-14T14:00:00+00:00</updated>
      <summary>In this guide, you&#x27;ll learn the main concepts of FastAPI and how to use it to quickly create web APIs that implement best practices by default. By the end of it, you will be able to start creating production-ready web APIs.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Creating APIs, or &lt;strong&gt;application programming interfaces&lt;/strong&gt;, is an important part of making your software accessible to a broad range of users. In this tutorial, you will learn the main concepts of &lt;strong&gt;FastAPI&lt;/strong&gt; and how to use it to quickly create web APIs that implement best practices by default.&lt;/p&gt;
&lt;p&gt;By the end of it, you will be able to start creating production-ready web APIs, and you will have the understanding needed to go deeper and learn more for your specific use cases.&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 &lt;strong&gt;path parameters&lt;/strong&gt; to get a unique URL path per item&lt;/li&gt;
&lt;li&gt;Receive JSON data in your requests using &lt;strong&gt;pydantic&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Use API best practices, including &lt;strong&gt;validation&lt;/strong&gt;, &lt;strong&gt;serialization&lt;/strong&gt;, and &lt;strong&gt;documentation&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Continue learning about FastAPI for &lt;strong&gt;your use cases&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This tutorial is written by the &lt;a href=&quot;https://realpython.com/team/sramirez/&quot;&gt;author of FastAPI&lt;/a&gt;. It contains a careful selection of fragments from the official documentation, avoiding getting lost in technical details while helping you get up to speed as fast as possible.&lt;/p&gt;
&lt;p&gt;To get the most out of this tutorial, it would be helpful for you to know the basics of &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview&quot;&gt;what HTTP is and how it works&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-json/&quot;&gt;what JSON is&lt;/a&gt;, and &lt;a href=&quot;https://fastapi.tiangolo.com/python-types/&quot;&gt;Python type hints&lt;/a&gt;. You will also benefit from using a &lt;a href=&quot;https://realpython.com/python-virtual-environments-a-primer/&quot;&gt;virtual environment&lt;/a&gt;, as is the case for any Python project.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&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; markdown=&quot;1&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’ll need to take your Python skills to the next level.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;what-is-fastapi&quot;&gt;What Is FastAPI?&lt;a class=&quot;headerlink&quot; href=&quot;#what-is-fastapi&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;FastAPI is a modern, high-performance web framework for building APIs with Python based on standard type hints. It has the following key features:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Fast to run&lt;/strong&gt;: It offers very high performance, on par with &lt;strong&gt;NodeJS&lt;/strong&gt; and &lt;strong&gt;Go&lt;/strong&gt;, thanks to &lt;a href=&quot;https://www.starlette.io/&quot;&gt;Starlette&lt;/a&gt; and &lt;a href=&quot;https://pydantic-docs.helpmanual.io/&quot;&gt;pydantic&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Fast to code&lt;/strong&gt;: It allows for significant increases in development speed.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reduced number of bugs&lt;/strong&gt;: It reduces the possibility for human-induced errors.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Intuitive&lt;/strong&gt;: It offers great editor support, with completion everywhere and less time debugging.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Straightforward&lt;/strong&gt;: It’s designed to be uncomplicated to use and learn, so you can spend less time reading documentation.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Short&lt;/strong&gt;: It minimizes code duplication.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Robust&lt;/strong&gt;: It provides production-ready code with automatic interactive documentation.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Standards-based&lt;/strong&gt;: It’s based on the open standards for APIs, &lt;a href=&quot;https://github.com/OAI/OpenAPI-Specification&quot;&gt;OpenAPI&lt;/a&gt; and &lt;a href=&quot;https://json-schema.org/&quot;&gt;JSON Schema&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The framework is designed to optimize your developer experience so that you can write simple code to build production-ready APIs with best practices by default.&lt;/p&gt;
&lt;h2 id=&quot;install-fastapi&quot;&gt;Install FastAPI&lt;a class=&quot;headerlink&quot; href=&quot;#install-fastapi&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;As with any other Python project, it would be best to start by creating a virtual environment. If you are not familiar with how to do that, then you can check out the &lt;a href=&quot;https://realpython.com/python-virtual-environments-a-primer/&quot;&gt;Primer on Virtual Environments&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The first step is to install FastAPI and &lt;a href=&quot;https://www.uvicorn.org/#introduction&quot;&gt;Uvicorn&lt;/a&gt; using &lt;a href=&quot;https://realpython.com/what-is-pip/&quot;&gt;&lt;code&gt;pip&lt;/code&gt;&lt;/a&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;python -m pip install fastapi uvicorn&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;standard&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;With that, you have FastAPI and Uvicorn installed and are ready to learn how to use them. FastAPI is the framework you’ll use to build your API, and Uvicorn is the server that will use the API you build to serve requests.&lt;/p&gt;
&lt;h2 id=&quot;first-steps&quot;&gt;First Steps&lt;a class=&quot;headerlink&quot; href=&quot;#first-steps&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;To get started, in this section, you will create a minimal FastAPI app, run it with a server using Uvicorn, and then learn all the interacting parts. This will give you a very quick overview of how everything works.&lt;/p&gt;
&lt;h3 id=&quot;create-a-first-api&quot;&gt;Create a First API&lt;a class=&quot;headerlink&quot; href=&quot;#create-a-first-api&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;A basic FastAPI file looks like this:&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;# main.py&lt;/span&gt;

&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;fastapi&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;FastAPI&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;app&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;FastAPI&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;

&lt;span class=&quot;nd&quot;&gt;@app&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;s2&quot;&gt;&quot;/&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;async&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;():&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;message&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Hello World&quot;&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;Copy the code above to a file named &lt;code&gt;main.py&lt;/code&gt;, and just like that, you have a fully functional API application with some best practices like automatic documentation and serialization built in. You will learn more about those features next.&lt;/p&gt;
&lt;p&gt;This code defines your application, but it won’t run on itself if you call it with &lt;code&gt;python&lt;/code&gt; directly. To run it, you need a &lt;strong&gt;server&lt;/strong&gt; program. In the steps above, you already installed &lt;a href=&quot;https://www.uvicorn.org/&quot;&gt;Uvicorn&lt;/a&gt;. That will be your server.&lt;/p&gt;
&lt;h3 id=&quot;run-the-first-api-app-with-uvicorn&quot;&gt;Run the First API App With Uvicorn&lt;a class=&quot;headerlink&quot; href=&quot;#run-the-first-api-app-with-uvicorn&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Run the live server using Uvicorn:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/fastapi-python-web-apis/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/fastapi-python-web-apis/ »&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 Square Root Function in Python</title>
      <id>https://realpython.com/courses/square-root-function-python/</id>
      <link href="https://realpython.com/courses/square-root-function-python/"/>
      <updated>2021-07-13T14:00:00+00:00</updated>
      <summary>In this quick and practical course, you&#x27;ll learn what a square root is and how to calculate one in Python. You&#x27;ll even see how you can use the Python square root function to solve a real-world problem.</summary>
      <content type="html">
        &lt;p&gt;Are you trying to solve a quadratic equation? Maybe you need to calculate the length of one side of a right triangle. You can use the &lt;code&gt;math&lt;/code&gt; module&amp;rsquo;s &lt;strong&gt;&lt;code&gt;sqrt()&lt;/code&gt;&lt;/strong&gt; method for determining the square root of a number. This course covers the use of &lt;code&gt;math.sqrt()&lt;/code&gt; as well as related methods.&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;About &lt;strong&gt;square roots&lt;/strong&gt; and related mathematical operations&lt;/li&gt;
&lt;li&gt;How to use the Python square root function, &lt;strong&gt;&lt;code&gt;sqrt()&lt;/code&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Where &lt;code&gt;sqrt()&lt;/code&gt; can be useful in &lt;strong&gt;real-world examples&lt;/strong&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>Python News: What&#x27;s New From June 2021?</title>
      <id>https://realpython.com/python-news-june-2021/</id>
      <link href="https://realpython.com/python-news-june-2021/"/>
      <updated>2021-07-12T14:00:00+00:00</updated>
      <summary>June 2021 was full of notable events in the Python world! In this article, you&#x27;ll get caught up on what&#x27;s been happening with Python during this past month, including some changes at the Python Software Foundation and the announcement of a new recipient of the PSF Fiscal Sponsorship Program.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;If you want to get up to speed on what happened in the world of &lt;strong&gt;Python&lt;/strong&gt; in &lt;strong&gt;June 2021&lt;/strong&gt;, then you’ve come to the right place to get your &lt;strong&gt;news&lt;/strong&gt;!&lt;/p&gt;
&lt;p&gt;June was a month of change. &lt;a href=&quot;https://twitter.com/ewa_jodlowska&quot;&gt;Ewa Jodlowska&lt;/a&gt;, the &lt;strong&gt;Executive Director of the Python Software Foundation (PSF)&lt;/strong&gt;, announced her departure after serving for ten years, and the PSF Board of Directors gained &lt;strong&gt;three new directors&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Let’s dive into the biggest Python news from the past month!&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&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; markdown=&quot;1&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’ll need to take your Python skills to the next level.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;ewa-jodlowska-steps-down-as-psf-executive-director&quot;&gt;Ewa Jodlowska Steps Down as PSF Executive Director&lt;a class=&quot;headerlink&quot; href=&quot;#ewa-jodlowska-steps-down-as-psf-executive-director&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;On June 16, the Python Software Foundation (PSF) &lt;a href=&quot;https://pyfound.blogspot.com/2021/06/update-on-python-software-foundation.html&quot;&gt;announced&lt;/a&gt; that Executive Director Ewa Jodlowska has decided to leave the foundation at the end of 2021.&lt;/p&gt;
&lt;p&gt;Even if you haven’t heard of Ewa, you’ve undoubtedly been impacted by her work. As Executive Director, Ewa is responsible for ensuring that the PSF achieves &lt;a href=&quot;https://www.python.org/psf/mission/&quot;&gt;its mission&lt;/a&gt; “to promote, protect, and advance the Python programming language, and to support and facilitate the growth of a diverse and international community of Python programmers.”&lt;/p&gt;
&lt;p&gt;The PSF is responsible for managing and maintaining the &lt;a href=&quot;https://python.org&quot;&gt;python.org&lt;/a&gt; website as well as the &lt;a href=&quot;https://pypi.org/&quot;&gt;Python Package Index&lt;/a&gt;. The PSF also supports and funds events and workshops for organizations such as &lt;a href=&quot;https://djangogirls.org/&quot;&gt;Django Girls&lt;/a&gt; and &lt;a href=&quot;https://pyladies.com/&quot;&gt;PyLadies&lt;/a&gt; as well as other Python conferences and meetups worldwide.&lt;/p&gt;
&lt;p&gt;In addition to managing community outreach, the PSF supports and funds Python software development. This includes organizing, funding, and supporting CPython sprints. As you’ll learn &lt;a href=&quot;#jazzband-accepted-to-the-psf-fiscal-sponsorship-program&quot;&gt;later&lt;/a&gt; in this article, the PSF’s funding and support go beyond support for the core Python language. The PSF also helps Python libraries with various grants and fiscal sponsorship programs.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-news-june-2021/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-news-june-2021/ »&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 #68: Exploring the functools Module and Complex Numbers in Python</title>
      <id>https://realpython.com/podcasts/rpp/68/</id>
      <link href="https://realpython.com/podcasts/rpp/68/"/>
      <updated>2021-07-09T12:00:00+00:00</updated>
      <summary>Are you ready to expand your Python knowledge into the intermediate to advanced territory? What tools are awaiting your discovery inside Python&#x27;s functools module? This week on the show, David Amos is back, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;Are you ready to expand your Python knowledge into the intermediate to advanced territory? What tools are awaiting your discovery inside Python&#x27;s functools module? This week on the show, David Amos is back, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.&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>What Can I Do With Python?</title>
      <id>https://realpython.com/what-can-i-do-with-python/</id>
      <link href="https://realpython.com/what-can-i-do-with-python/"/>
      <updated>2021-07-07T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll find a set of guidelines that will help you start applying your Python skills to real-world problems. By the end of your reading, you&#x27;ll be able to answer the question &quot;What can I do with Python?&quot;</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;You’ve finished a course or finally made it to the end of a &lt;a href=&quot;https://realpython.com/products/python-basics-book/&quot;&gt;book&lt;/a&gt; that teaches you the &lt;a href=&quot;https://realpython.com/learning-paths/python3-introduction/&quot;&gt;basics of programming with Python&lt;/a&gt;. You’ve learned about &lt;a href=&quot;https://realpython.com/python-variables/&quot;&gt;variables&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-lists-tuples/&quot;&gt;lists, tuples&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-dicts/&quot;&gt;dictionaries&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-for-loop/&quot;&gt;&lt;code&gt;for&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/python-while-loop/&quot;&gt;&lt;code&gt;while&lt;/code&gt;&lt;/a&gt; loops, &lt;a href=&quot;https://realpython.com/python-conditional-statements/&quot;&gt;conditional statements&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python3-object-oriented-programming/&quot;&gt;object-oriented concepts&lt;/a&gt;, and more. So, what’s next? What can you do with Python nowadays?&lt;/p&gt;
&lt;p&gt;Python is a versatile programming language with many use cases in a variety of different fields. If you’ve grasped the basics of Python and are itching to build something with the language, then it’s time to figure out what your next step should be.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this article, you’ll see how you can use Python for:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Doing general &lt;strong&gt;software development&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Diving into &lt;strong&gt;data science and math&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Speeding up and automating your &lt;strong&gt;workflow&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Building &lt;strong&gt;embedded systems&lt;/strong&gt; and &lt;strong&gt;robots&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You’ll also find ideas for practical projects, resources, and tutorials that you can use to start building things with Python right away.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&gt;Free Bonus:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-basics-sample-free-chapter/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-basics-sample-free-chapter&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Get a sample chapter from Python Basics: A Practical Introduction to Python 3&lt;/a&gt; to see how you can go from beginner to intermediate in Python with a complete curriculum, up to date for Python 3.9.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;python-in-the-real-world&quot;&gt;Python in the Real World&lt;a class=&quot;headerlink&quot; href=&quot;#python-in-the-real-world&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Python is a high-level and general-purpose programming language. As this definition implies, you can use Python for &lt;a href=&quot;https://www.jetbrains.com/lp/python-developers-survey-2020/#PurposesUsingPython&quot;&gt;several purposes&lt;/a&gt;, from &lt;a href=&quot;https://realpython.com/tutorials/web-dev/&quot;&gt;web development&lt;/a&gt; to &lt;a href=&quot;https://realpython.com/tutorials/data-science/&quot;&gt;data science&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/tutorials/machine-learning/&quot;&gt;machine learning&lt;/a&gt;, and &lt;a href=&quot;https://talkpython.fm/episodes/show/232/become-a-robot-developer-with-python&quot;&gt;robotics&lt;/a&gt;. Python’s real-world use cases are limitless.&lt;/p&gt;
&lt;p&gt;You’re probably wondering what people are &lt;a href=&quot;https://www.python.org/success-stories/&quot;&gt;successfully building&lt;/a&gt; with Python. If you take a quick look at companies using the language, then you’ll find &lt;a href=&quot;https://realpython.com/world-class-companies-using-python/&quot;&gt;world-class companies&lt;/a&gt;, such as Google, YouTube, Facebook, Instagram, Spotify, Netflix, and more.&lt;/p&gt;
&lt;p&gt;Google has used Python &lt;a href=&quot;https://stackoverflow.com/questions/2560310/heavy-usage-of-python-at-google/2561008#2561008&quot;&gt;from the start&lt;/a&gt;, and it’s gained a place as one of the tech giant’s main server-side languages. &lt;a href=&quot;https://twitter.com/gvanrossum&quot;&gt;Guido van Rossum&lt;/a&gt;, Python’s creator, worked there for several years, overseeing the language’s development.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://pyfound.blogspot.com/2021/05/the-2021-python-language-summit-cpython.html&quot;&gt;Instagram likes Python&lt;/a&gt; for its simplicity. The service &lt;a href=&quot;https://instagram-engineering.com/web-service-efficiency-at-instagram-with-python-4976d078e366&quot;&gt;is known for&lt;/a&gt; running “the world’s largest deployment of the Django web framework, which is written entirely in Python.”&lt;/p&gt;
&lt;p&gt;Spotify uses the language for data analysis and back-end services. According to its team, Python’s ease of use leads to a lightning-fast development pipeline. Spotify performs a ton of analysis to give recommendations to its users, so it needs a productive tool that works well. Python to the rescue!&lt;/p&gt;
&lt;p&gt;You’ll also find that Python has been vital for science and &lt;a href=&quot;https://realpython.com/python-news-march-2021/#python-lands-on-mars&quot;&gt;space exploration&lt;/a&gt;, with a lot of exciting use cases in &lt;a href=&quot;https://en.wikipedia.org/wiki/Robotics&quot;&gt;robotics&lt;/a&gt; and hardware control.&lt;/p&gt;
&lt;p&gt;In this article, you’ll see how you can use your Python skills in a wide range of areas.&lt;/p&gt;
&lt;h2 id=&quot;develop-cool-software&quot;&gt;Develop Cool Software&lt;a class=&quot;headerlink&quot; href=&quot;#develop-cool-software&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Python’s ecosystem provides a rich set of &lt;a href=&quot;https://en.wikipedia.org/wiki/Software_framework&quot;&gt;frameworks&lt;/a&gt;, tools, and libraries that allow you to write almost any kind of application. You can use Python to build applications for the &lt;a href=&quot;https://en.wikipedia.org/wiki/World_Wide_Web&quot;&gt;Web&lt;/a&gt; as well as &lt;a href=&quot;https://en.wikipedia.org/wiki/Desktop_metaphor&quot;&gt;desktop&lt;/a&gt; and &lt;a href=&quot;https://en.wikipedia.org/wiki/Mobile_computing&quot;&gt;mobile&lt;/a&gt; platforms. You can even use Python to create video games.&lt;/p&gt;
&lt;h3 id=&quot;web-development&quot;&gt;Web Development&lt;a class=&quot;headerlink&quot; href=&quot;#web-development&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Developing web applications with Python is one of the most in-demand skills, with a lot of opportunities for you out there. In this field, you’ll find several useful Python frameworks, libraries, and tools for developing cool web applications, APIs, and more. Here are some of the most popular Python web frameworks:&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;Framework&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://www.djangoproject.com/&quot;&gt;Django&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Django is a high-level framework that encourages rapid web application development with a clean and pragmatic design. It allows you to focus on writing your applications without having to reinvent the wheel.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://fastapi.tiangolo.com/&quot;&gt;FastAPI&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;FastAPI is a fast and performant web framework for building web APIs. It’s built on top of modern Python type hint features and enables &lt;a href=&quot;https://realpython.com/async-io-python/&quot;&gt;asynchronous&lt;/a&gt; programming.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://palletsprojects.com/p/flask/&quot;&gt;Flask&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Flask is a lightweight framework for creating &lt;a href=&quot;https://wsgi.readthedocs.io/&quot;&gt;WSGI&lt;/a&gt; web applications. It allows you to get started quickly and to scale up to complex applications if needed.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tornadoweb.org/en/stable/&quot;&gt;Tornado&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Tornado is a web framework and asynchronous networking library. It uses non-blocking network &lt;a href=&quot;https://en.wikipedia.org/wiki/Input/output&quot;&gt;I/O&lt;/a&gt;, so you can write applications that can scale to tens of thousands of open connections.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;To get started with web development, check out:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/tutorials/web-dev/&quot;&gt;Python Web Development Tutorials&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/tutorials/django/&quot;&gt;Django Tutorials&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/tutorials/flask/&quot;&gt;Flask Tutorials&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you want some practical project ideas for applying your web development skills right away, then you can build a &lt;a href=&quot;https://realpython.com/get-started-with-django-1/&quot;&gt;portfolio web application with Django&lt;/a&gt;. With so many jobs and career opportunities out there, it’s a great idea to have a personal portfolio these days, so go ahead and give it a try. You don’t need to know anything about Django to get started with this step-by-step tutorial. It’s perfect if you’re itching to get your hands dirty with web development in Python.&lt;/p&gt;
&lt;h3 id=&quot;cli-development&quot;&gt;CLI Development&lt;a class=&quot;headerlink&quot; href=&quot;#cli-development&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Another field in which Python shines is &lt;a href=&quot;https://en.wikipedia.org/wiki/Command-line_interface&quot;&gt;command-line interface (CLI)&lt;/a&gt; application development. CLI applications are everywhere and allow you to automate repetitive and boring tasks in your day-to-day work by creating small and large tools for your command line.&lt;/p&gt;
&lt;p&gt;In Python, you have an impressive set of CLI libraries and frameworks that can make your life more pleasant and help you build command-line tools quickly:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/what-can-i-do-with-python/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/what-can-i-do-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>Defining and Calling Python Functions</title>
      <id>https://realpython.com/courses/defining-and-calling-functions/</id>
      <link href="https://realpython.com/courses/defining-and-calling-functions/"/>
      <updated>2021-07-06T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll learn how to define and call your own Python function.  You&#x27;ll also learn about passing data to your function and returning data from your function back to its calling environment.</summary>
      <content type="html">
        &lt;p&gt;A &lt;strong&gt;function&lt;/strong&gt; is a self-contained block of code that encapsulates a specific task or related group of tasks. This course will show you how to &lt;strong&gt;define your own Python function&lt;/strong&gt;. You&amp;rsquo;ll learn when to divide your program into separate user-defined functions and what tools you&amp;rsquo;ll need to do this. &lt;/p&gt;
&lt;p&gt;You&amp;rsquo;ll also learn the various ways to pass data into a function when calling it, which allows for different behavior from one invocation to the next.&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 &lt;strong&gt;functions&lt;/strong&gt; work in Python and why they&amp;rsquo;re beneficial&lt;/li&gt;
&lt;li&gt;How to &lt;strong&gt;define and call&lt;/strong&gt; your own Python function&lt;/li&gt;
&lt;li&gt;Mechanisms for &lt;strong&gt;passing arguments&lt;/strong&gt; to your function&lt;/li&gt;
&lt;li&gt;Some differences between how to work with functions in &lt;strong&gt;Python vs C++&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to &lt;strong&gt;return data&lt;/strong&gt; from your function back to the calling environment&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This course will be the most helpful for you if you&amp;rsquo;re already familiar with the fundamental concepts of Python, including &lt;a href=&quot;https://realpython.com/python-data-types/&quot;&gt;basic data types&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-lists-tuples/&quot;&gt;lists and tuples&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-dicts/&quot;&gt;dictionaries&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/lessons/import-statement/&quot;&gt;the import statement&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-conditional-statements/&quot;&gt;conditional statements&lt;/a&gt;, and &lt;a href=&quot;https://realpython.com/python-for-loop/&quot;&gt;for loops&lt;/a&gt;.&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&#x27;s Counter: The Pythonic Way to Count Objects</title>
      <id>https://realpython.com/python-counter/</id>
      <link href="https://realpython.com/python-counter/"/>
      <updated>2021-07-05T14:00:00+00:00</updated>
      <summary>In this step-by-step tutorial, you&#x27;ll learn how to use Python&#x27;s Counter to count several repeated objects at once.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Counting several repeated objects at once is a common problem in programming. Python offers a bunch of tools and techniques you can use to approach this problem. However, Python’s &lt;strong&gt;&lt;code&gt;Counter&lt;/code&gt;&lt;/strong&gt; from &lt;a href=&quot;https://docs.python.org/3/library/collections.html#module-collections&quot;&gt;&lt;code&gt;collections&lt;/code&gt;&lt;/a&gt; provides a clean, efficient, and Pythonic solution.&lt;/p&gt;
&lt;p&gt;This &lt;a href=&quot;https://realpython.com/python-dicts/&quot;&gt;dictionary&lt;/a&gt; subclass provides efficient counting capabilities out of the box. Understanding &lt;code&gt;Counter&lt;/code&gt; and how to use it efficiently is a convenient skill to have as a Python developer.&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;Count &lt;strong&gt;several repeated objects&lt;/strong&gt; at once&lt;/li&gt;
&lt;li&gt;Create counters with Python’s &lt;strong&gt;&lt;code&gt;Counter&lt;/code&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Retrieve the &lt;strong&gt;most common objects&lt;/strong&gt; in a counter&lt;/li&gt;
&lt;li&gt;Update &lt;strong&gt;object counts&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;Counter&lt;/code&gt; to facilitate &lt;strong&gt;further computations&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You’ll also learn about the basics of using &lt;code&gt;Counter&lt;/code&gt; as a &lt;a href=&quot;https://en.wikipedia.org/wiki/Multiset&quot;&gt;multiset&lt;/a&gt;, which is an additional feature of this class in Python.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&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; markdown=&quot;1&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’ll need to take your Python skills to the next level.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;counting-objects-in-python&quot;&gt;Counting Objects in Python&lt;a class=&quot;headerlink&quot; href=&quot;#counting-objects-in-python&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Sometimes you need to count the objects in a given data source to know how often they occur. In other words, you need to determine their &lt;strong&gt;frequency&lt;/strong&gt;. For example, you might want to know how often a specific item appears in a list or sequence of values. When your list is short, counting the items can be straightforward and quick. However, when you have a long list, counting things can be more challenging.&lt;/p&gt;
&lt;p&gt;To count objects, you typically use a &lt;strong&gt;counter&lt;/strong&gt;, which is an &lt;a href=&quot;https://realpython.com/python-numbers/#integers&quot;&gt;integer variable&lt;/a&gt; with an initial value of zero. Then you increment the counter to reflect the number of times a given object appears in the input data source.&lt;/p&gt;
&lt;p&gt;When you’re counting the occurrences of a single object, you can use a single counter. However, when you need to count several different objects, you have to create as many counters as unique objects you have.&lt;/p&gt;
&lt;p&gt;To count several different objects at once, you can use a Python dictionary. The dictionary &lt;strong&gt;keys&lt;/strong&gt; will store the objects you want to count. The dictionary &lt;strong&gt;values&lt;/strong&gt; will hold the number of repetitions of a given object, or the object’s &lt;strong&gt;count&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;For example, to count the objects in a sequence using a dictionary, you can loop over the sequence, check if the current object isn’t in the dictionary to initialize the counter (key-value pair), and then increment its count accordingly.&lt;/p&gt;
&lt;p&gt;Here’s an example that counts the letters in the word “Mississippi”:&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;n&quot;&gt;word&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;mississippi&quot;&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;counter&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;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;letter&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;word&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;letter&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;counter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;        &lt;span class=&quot;n&quot;&gt;counter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;letter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;counter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;letter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;...&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;counter&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;{&#x27;m&#x27;: 1, &#x27;i&#x27;: 4, &#x27;s&#x27;: 4, &#x27;p&#x27;: 2}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The &lt;a href=&quot;https://realpython.com/python-for-loop/&quot;&gt;&lt;code&gt;for&lt;/code&gt; loop&lt;/a&gt; iterates over the letters in &lt;code&gt;word&lt;/code&gt;. In each iteration, the &lt;a href=&quot;https://realpython.com/python-conditional-statements/&quot;&gt;conditional statement&lt;/a&gt; checks if the letter at hand isn’t already a key in the dictionary you’re using as &lt;code&gt;counter&lt;/code&gt;. If so, it creates a new key with the letter and initializes its count to zero. The final step is to increment the count by one. When you access &lt;code&gt;counter&lt;/code&gt;, you see that the letters work as keys and the values as counts.&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; When you’re counting several repeated objects with Python dictionaries, keep in mind that they must be &lt;a href=&quot;https://docs.python.org/3/glossary.html#term-hashable&quot;&gt;hashable&lt;/a&gt; because they’ll work as dictionary keys. Being &lt;strong&gt;hashable&lt;/strong&gt; means that your objects must have a hash value that never changes during their lifetime. In Python, &lt;a href=&quot;https://docs.python.org/3/glossary.html#term-immutable&quot;&gt;immutable&lt;/a&gt; objects are also hashable.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Another way to count objects with a dictionary is to use &lt;a href=&quot;https://docs.python.org/3/library/stdtypes.html#dict.get&quot;&gt;&lt;code&gt;dict.get()&lt;/code&gt;&lt;/a&gt; with &lt;code&gt;0&lt;/code&gt; as a default value:&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;n&quot;&gt;word&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;mississippi&quot;&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;counter&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;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;letter&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;word&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;counter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;letter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;counter&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;n&quot;&gt;letter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;...&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;counter&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;{&#x27;m&#x27;: 1, &#x27;i&#x27;: 4, &#x27;s&#x27;: 4, &#x27;p&#x27;: 2}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;When you call &lt;code&gt;.get()&lt;/code&gt; this way, you get the current count of a given &lt;code&gt;letter&lt;/code&gt;, or &lt;code&gt;0&lt;/code&gt; (the default) if the letter is missing. Then you increment the count by &lt;code&gt;1&lt;/code&gt; and store it under the corresponding &lt;code&gt;letter&lt;/code&gt; in the dictionary.&lt;/p&gt;
&lt;p&gt;You can also use &lt;a href=&quot;https://realpython.com/python-defaultdict/&quot;&gt;&lt;code&gt;defaultdict&lt;/code&gt;&lt;/a&gt; from &lt;a href=&quot;https://docs.python.org/3/library/collections.html#module-collections&quot;&gt;&lt;code&gt;collections&lt;/code&gt;&lt;/a&gt; to count objects within a loop:&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;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;collections&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;defaultdict&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;word&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;mississippi&quot;&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;counter&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;defaultdict&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;letter&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;word&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;counter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;letter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;...&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;counter&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;defaultdict(&amp;lt;class &#x27;int&#x27;&amp;gt;, {&#x27;m&#x27;: 1, &#x27;i&#x27;: 4, &#x27;s&#x27;: 4, &#x27;p&#x27;: 2})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This solution is more concise and readable. You first initialize the &lt;code&gt;counter&lt;/code&gt; using a &lt;code&gt;defaultdict&lt;/code&gt; with &lt;a href=&quot;https://docs.python.org/3/library/functions.html#int&quot;&gt;&lt;code&gt;int()&lt;/code&gt;&lt;/a&gt; as a default factory function. This way, when you access a key that doesn’t exist in the underlying &lt;code&gt;defaultdict&lt;/code&gt;, the dictionary automatically creates the key and initializes it with the value that the factory function returns.&lt;/p&gt;
&lt;p&gt;In this example, since you’re using &lt;code&gt;int()&lt;/code&gt; as a &lt;a href=&quot;https://realpython.com/factory-method-python/&quot;&gt;factory function&lt;/a&gt;, the initial value is &lt;code&gt;0&lt;/code&gt;, which results from calling &lt;code&gt;int()&lt;/code&gt; without arguments.&lt;/p&gt;
&lt;p&gt;Like with many other frequent tasks in programming, Python provides a better way to approach the counting problem. In &lt;code&gt;collections&lt;/code&gt;, you’ll find a class specially designed to count several different objects in one go. This class is conveniently called &lt;a href=&quot;https://docs.python.org/3/library/collections.html#collections.Counter&quot;&gt;&lt;code&gt;Counter&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;getting-started-with-pythons-counter&quot;&gt;Getting Started With Python’s &lt;code&gt;Counter&lt;/code&gt;&lt;a class=&quot;headerlink&quot; href=&quot;#getting-started-with-pythons-counter&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-counter/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-counter/ »&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 #67: Securing Your Python Software Supply Chain With Dustin Ingram</title>
      <id>https://realpython.com/podcasts/rpp/67/</id>
      <link href="https://realpython.com/podcasts/rpp/67/"/>
      <updated>2021-07-02T12:00:00+00:00</updated>
      <summary>How well do you know your software supply chain? When you PIP install a package, what steps can you take to minimize the risk of installing something malicious? This week on the show, we have Dustin Ingram, a director of the Python Software Foundation (PSF) and a maintainer of the Python Package Index (PyPI).</summary>
      <content type="html">
        &lt;p&gt;How well do you know your software supply chain? When you PIP install a package, what steps can you take to minimize the risk of installing something malicious? This week on the show, we have Dustin Ingram, a director of the Python Software Foundation (PSF) and a maintainer of the Python Package Index (PyPI).&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>Beautiful Soup: Build a Web Scraper With Python</title>
      <id>https://realpython.com/beautiful-soup-web-scraper-python/</id>
      <link href="https://realpython.com/beautiful-soup-web-scraper-python/"/>
      <updated>2021-06-30T12:58:06+00:00</updated>
      <summary>In this tutorial, you&#x27;ll walk through the main steps of the web scraping process. You&#x27;ll learn how to write a script that uses Python&#x27;s requests library to scrape data from a website. You&#x27;ll also use Beautiful Soup to extract the specific pieces of information that you&#x27;re interested in.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;The incredible amount of data on the Internet is a rich resource for any field of research or personal interest. To effectively harvest that data, you’ll need to become skilled at &lt;a href=&quot;https://realpython.com/python-web-scraping-practical-introduction/&quot;&gt;&lt;strong&gt;web scraping&lt;/strong&gt;&lt;/a&gt;. The Python libraries &lt;code&gt;requests&lt;/code&gt; and Beautiful Soup are powerful tools for the job. If you like to learn with hands-on examples and have a basic understanding of Python and HTML, then this tutorial is for you.&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;Inspect the &lt;strong&gt;HTML structure&lt;/strong&gt; of your target site with your browser’s &lt;strong&gt;developer tools&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Decipher data encoded in &lt;strong&gt;URLs&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;requests&lt;/code&gt; and Beautiful Soup for &lt;strong&gt;scraping and parsing data&lt;/strong&gt; from the Web&lt;/li&gt;
&lt;li&gt;Step through a &lt;strong&gt;web scraping pipeline&lt;/strong&gt; from start to finish&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Build a script&lt;/strong&gt; that fetches job offers from the Web and displays relevant information in your console&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Working through this project will give you the knowledge of the process and tools you need to scrape any static website out there on the World Wide Web. You can download the project source code 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 markdown=&quot;1&quot;&gt;Get Sample Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/beautiful-soup/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-beautiful-soup&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to get the sample code you’ll use&lt;/a&gt; for the project and examples in this tutorial.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Let’s get started!&lt;/p&gt;
&lt;h2 id=&quot;what-is-web-scraping&quot;&gt;What Is Web Scraping?&lt;a class=&quot;headerlink&quot; href=&quot;#what-is-web-scraping&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Web scraping&lt;/strong&gt; is the process of gathering information from the Internet. Even copying and pasting the lyrics of your favorite song is a form of web scraping! However, the words “web scraping” usually refer to a process that involves automation. &lt;a href=&quot;https://realpython.com/podcasts/rpp/12/&quot;&gt;Some websites don’t like it when automatic scrapers gather their data&lt;/a&gt;, while others don’t mind.&lt;/p&gt;
&lt;p&gt;If you’re scraping a page respectfully for educational purposes, then you’re unlikely to have any problems. Still, it’s a good idea to do some research on your own and make sure that you’re not &lt;a href=&quot;https://benbernardblog.com/web-scraping-and-crawling-are-perfectly-legal-right/&quot;&gt;violating any Terms of Service&lt;/a&gt; before you start a large-scale project.&lt;/p&gt;
&lt;h3 id=&quot;reasons-for-web-scraping&quot;&gt;Reasons for Web Scraping&lt;a class=&quot;headerlink&quot; href=&quot;#reasons-for-web-scraping&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Say you’re a surfer, both online and in real life, and you’re looking for employment. However, you’re not looking for just &lt;em&gt;any&lt;/em&gt; job. With a surfer’s mindset, you’re waiting for the perfect opportunity to roll your way!&lt;/p&gt;
&lt;p&gt;There’s a job site that offers precisely the kinds of jobs you want. Unfortunately, a new position only pops up once in a blue moon, and the site doesn’t provide an email notification service. You think about checking up on it every day, but that doesn’t sound like the most fun and productive way to spend your time.&lt;/p&gt;
&lt;p&gt;Thankfully, the world offers other ways to apply that surfer’s mindset! Instead of looking at the job site every day, you can use Python to help automate your job search’s repetitive parts. &lt;strong&gt;Automated web scraping&lt;/strong&gt; can be a solution to speed up the data collection process. You write your code once, and it will get the information you want many times and from many pages.&lt;/p&gt;
&lt;p&gt;In contrast, when you try to get the information you want manually, you might spend a lot of time clicking, scrolling, and searching, especially if you need large amounts of data from websites that are regularly updated with new content. Manual web scraping can take a lot of time and repetition.&lt;/p&gt;
&lt;p&gt;There’s so much information on the Web, and new information is constantly added. You’ll probably be interested in at least some of that data, and much of it is just out there for the taking. Whether you’re actually on the job hunt or you want to download all the lyrics of your favorite artist, automated web scraping can help you accomplish your goals.&lt;/p&gt;
&lt;h3 id=&quot;challenges-of-web-scraping&quot;&gt;Challenges of Web Scraping&lt;a class=&quot;headerlink&quot; href=&quot;#challenges-of-web-scraping&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The Web has grown organically out of many sources. It combines many different technologies, styles, and personalities, and it continues to grow to this day. In other words, the Web is a hot mess! Because of this, you’ll run into some challenges when scraping the Web:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Variety:&lt;/strong&gt; Every website is different. While you’ll encounter general structures that repeat themselves, each website is unique and will need personal treatment if you want to extract the relevant information.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Durability:&lt;/strong&gt; Websites constantly change. Say you’ve built a shiny new web scraper that automatically cherry-picks what you want from your resource of interest. The first time you &lt;a href=&quot;https://realpython.com/run-python-scripts/&quot;&gt;run your script&lt;/a&gt;, it works flawlessly. But when you run the same script only a short while later, you run into a discouraging and lengthy stack of &lt;a href=&quot;https://realpython.com/python-traceback/&quot;&gt;tracebacks&lt;/a&gt;!&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Unstable scripts are a realistic scenario, as many websites are in active development. Once the site’s structure has changed, your scraper might not be able to navigate the sitemap correctly or find the relevant information. The good news is that many changes to websites are small and incremental, so you’ll likely be able to update your scraper with only minimal adjustments.&lt;/p&gt;
&lt;p&gt;However, keep in mind that because the Internet is dynamic, the scrapers you’ll build will probably require constant maintenance. You can set up &lt;a href=&quot;https://realpython.com/python-continuous-integration/&quot;&gt;continuous integration&lt;/a&gt; to run scraping tests periodically to ensure that your main script doesn’t break without your knowledge.&lt;/p&gt;
&lt;h3 id=&quot;an-alternative-to-web-scraping-apis&quot;&gt;An Alternative to Web Scraping: APIs&lt;a class=&quot;headerlink&quot; href=&quot;#an-alternative-to-web-scraping-apis&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Some website providers offer &lt;a href=&quot;https://realpython.com/python-api/&quot;&gt;application programming interfaces (APIs)&lt;/a&gt; that allow you to access their data in a predefined manner. With APIs, you can avoid parsing HTML. Instead, you can access the data directly using formats like &lt;a href=&quot;https://realpython.com/python-json/&quot;&gt;JSON&lt;/a&gt; and XML. HTML is primarily a way to present content to users visually.&lt;/p&gt;
&lt;p&gt;When you use an API, the process is generally more stable than gathering the data through web scraping. That’s because developers create APIs to be consumed by programs rather than by human eyes.&lt;/p&gt;
&lt;p&gt;The front-end presentation of a site might change often, but such a change in the website’s design doesn’t affect its API structure. The structure of an API is usually more permanent, which means it’s a more reliable source of the site’s data.&lt;/p&gt;
&lt;p&gt;However, APIs &lt;em&gt;can&lt;/em&gt; change as well. The challenges of both variety and durability apply to APIs just as they do to websites. Additionally, it’s much harder to inspect the structure of an API by yourself if the provided documentation lacks quality.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/beautiful-soup-web-scraper-python/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/beautiful-soup-web-scraper-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>Python Inner Functions</title>
      <id>https://realpython.com/courses/python-inner-functions/</id>
      <link href="https://realpython.com/courses/python-inner-functions/"/>
      <updated>2021-06-29T14:00:00+00:00</updated>
      <summary>In this step-by-step course, you&#x27;ll learn what inner functions are in Python, how to define them, and what their main use cases are.</summary>
      <content type="html">
        &lt;p&gt;Python allows the declaration of functions inside of other &lt;a href=&quot;https://realpython.com/defining-your-own-python-function/&quot;&gt;functions&lt;/a&gt;. &lt;strong&gt;Inner functions&lt;/strong&gt;, also known as &lt;strong&gt;nested functions&lt;/strong&gt;, are defined within a function. This type of function has direct access to variables and names defined in the enclosing function in Python. Inner functions have many uses, most notably as closure factories and decorator functions.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll learn how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Define&lt;/strong&gt; inner functions&lt;/li&gt;
&lt;li&gt;Use inner functions as &lt;strong&gt;helper functions&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Build &lt;strong&gt;function closures&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Use captured variables in a closure&lt;/li&gt;
&lt;li&gt;Use captured data functions in a closure&lt;/li&gt;
&lt;li&gt;Work with &lt;strong&gt;decorators&lt;/strong&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>Reverse Python Lists: Beyond .reverse() and reversed()</title>
      <id>https://realpython.com/python-reverse-list/</id>
      <link href="https://realpython.com/python-reverse-list/"/>
      <updated>2021-06-28T14:00:00+00:00</updated>
      <summary>In this step-by-step tutorial, you&#x27;ll learn about Python&#x27;s tools and techniques to work with lists in reverse order. You&#x27;ll also learn how to reverse your list by hand.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Are you diving deeper into Python lists and wanting to learn about different ways to reverse them? If so, then this tutorial is for you. Here, you’ll learn about a few Python tools and techniques that are handy when it comes to reversing lists or manipulating them in reverse order. This knowledge will complement and improve your list-related skills and make you more proficient with them.&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;Reverse existing lists &lt;strong&gt;in place&lt;/strong&gt; using &lt;strong&gt;&lt;code&gt;.reverse()&lt;/code&gt;&lt;/strong&gt; and other techniques&lt;/li&gt;
&lt;li&gt;Create reversed copies of existing lists using &lt;strong&gt;&lt;code&gt;reversed()&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;slicing&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Use &lt;strong&gt;iteration&lt;/strong&gt;, &lt;strong&gt;comprehensions&lt;/strong&gt;, and &lt;strong&gt;recursion&lt;/strong&gt; to create reversed lists&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Iterate&lt;/strong&gt; over your lists in reverse order&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Sort&lt;/strong&gt; your lists in reverse order using &lt;code&gt;.sort()&lt;/code&gt; and &lt;code&gt;sorted()&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To get the most out of this tutorial, it would be helpful to know the basics of &lt;a href=&quot;https://docs.python.org/3/glossary.html#term-iterable&quot;&gt;iterables&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-for-loop/&quot;&gt;&lt;code&gt;for&lt;/code&gt; loops&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-lists-tuples/&quot;&gt;lists&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/list-comprehension-python/&quot;&gt;list comprehensions&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/introduction-to-python-generators/#building-generators-with-generator-expressions&quot;&gt;generator expressions&lt;/a&gt;, and &lt;a href=&quot;https://realpython.com/python-recursion/&quot;&gt;recursion&lt;/a&gt;.&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-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;reversing-python-lists&quot;&gt;Reversing Python Lists&lt;a class=&quot;headerlink&quot; href=&quot;#reversing-python-lists&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Sometimes you need to process Python lists starting from the last element down to the first—in other words, in &lt;strong&gt;reverse order&lt;/strong&gt;. In general, there are two main challenges related to working with lists in reverse:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Reversing a list in place&lt;/li&gt;
&lt;li&gt;Creating reversed copies of an existing list&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;To meet the first challenge, you can use either &lt;code&gt;.reverse()&lt;/code&gt; or a loop that swaps items by index. For the second, you can use &lt;a href=&quot;https://docs.python.org/dev/library/functions.html?highlight=built#reversed&quot;&gt;&lt;code&gt;reversed()&lt;/code&gt;&lt;/a&gt; or a &lt;a href=&quot;https://docs.python.org/dev/whatsnew/2.3.html#extended-slices&quot;&gt;slicing operation&lt;/a&gt;. In the next sections, you’ll learn about different ways to accomplish both in your code.&lt;/p&gt;
&lt;h3 id=&quot;reversing-lists-in-place&quot;&gt;Reversing Lists in Place&lt;a class=&quot;headerlink&quot; href=&quot;#reversing-lists-in-place&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Like other &lt;a href=&quot;https://docs.python.org/dev/library/stdtypes.html#mutable-sequence-types&quot;&gt;mutable sequence&lt;/a&gt; types, Python lists implement &lt;code&gt;.reverse()&lt;/code&gt;. This method reverses the underlying list &lt;a href=&quot;https://en.wikipedia.org/wiki/In-place_algorithm&quot;&gt;in place&lt;/a&gt; for memory efficiency when you’re reversing large list objects. Here’s how you can use &lt;code&gt;.reverse()&lt;/code&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;n&quot;&gt;digits&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;mi&quot;&gt;0&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;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&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;mi&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;digits&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;reverse&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;digits&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;When you call &lt;code&gt;.reverse()&lt;/code&gt; on an existing list, the method reverses it in place. This way, when you access the list again, you get it in reverse order. Note that &lt;code&gt;.reverse()&lt;/code&gt; doesn’t &lt;a href=&quot;https://realpython.com/python-return-statement/&quot;&gt;return&lt;/a&gt; a new list but &lt;a href=&quot;https://realpython.com/null-in-python/&quot;&gt;&lt;code&gt;None&lt;/code&gt;&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;n&quot;&gt;digits&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;mi&quot;&gt;0&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;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&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;mi&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;reversed_digits&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;digits&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;reverse&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;reversed_digits&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;None&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;True&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Trying to assign the return value of &lt;code&gt;.reverse()&lt;/code&gt; to a variable is a common mistake related to using this method. The intent of returning &lt;code&gt;None&lt;/code&gt; is to remind its users that &lt;code&gt;.reverse()&lt;/code&gt; operates by &lt;a href=&quot;https://en.wikipedia.org/wiki/Side_effect_(computer_science)&quot;&gt;side effect&lt;/a&gt;, changing the underlying list.&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; Most of the examples in this tutorial use a list of &lt;a href=&quot;https://realpython.com/python-numbers/&quot;&gt;numbers&lt;/a&gt; as input. However, the same tools and techniques apply to lists of any type of Python objects, such as lists of &lt;a href=&quot;https://realpython.com/python-strings/&quot;&gt;strings&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Okay! That was quick and straightforward! Now, how can you reverse a list in place by hand? A common technique is to loop through the first half of it while swapping each element with its mirror counterpart on the second half of the list.&lt;/p&gt;
&lt;p&gt;Python provides zero-based positive indices to walk sequences from left to right. It also allows you to navigate sequences from right to left using negative indices:&lt;/p&gt;
&lt;figure&gt;&lt;a href=&quot;https://files.realpython.com/media/python-list-indices.35560d02fcd4.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/python-list-indices.35560d02fcd4.png&quot; width=&quot;404&quot; height=&quot;252&quot; srcset=&quot;https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/python-list-indices.35560d02fcd4.png&amp;amp;w=101&amp;amp;sig=9c8daf19346603653b9cada7058fa6677b2af970 101w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/python-list-indices.35560d02fcd4.png&amp;amp;w=202&amp;amp;sig=05b1147e011246d6db62cbc3443aaf7df2877a80 202w, https://files.realpython.com/media/python-list-indices.35560d02fcd4.png 404w&quot; sizes=&quot;75vw&quot; alt=&quot;Python list with indices&quot; data-asset=&quot;3581&quot;&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;This diagram shows that you can access the first element of the list (or sequence) using either &lt;code&gt;0&lt;/code&gt; or &lt;code&gt;-5&lt;/code&gt; with the indexing operator, like in &lt;code&gt;sequence[0]&lt;/code&gt; and &lt;code&gt;sequence[-5]&lt;/code&gt;, respectively. You can use this Python feature to reverse the underlying sequence in place.&lt;/p&gt;
&lt;p&gt;For example, to reverse the list represented in the diagram, you can loop over the first half of the list and swap the element at index &lt;code&gt;0&lt;/code&gt; with its mirror at index &lt;code&gt;-1&lt;/code&gt; in the first iteration. Then you can switch the element at index &lt;code&gt;1&lt;/code&gt; with its mirror at index &lt;code&gt;-2&lt;/code&gt; and so on until you get the list reversed.&lt;/p&gt;
&lt;p&gt;Here’s a representation of the whole process:&lt;/p&gt;
&lt;figure&gt;&lt;a href=&quot;https://files.realpython.com/media/python-reverse-list.220302c8f5a4.gif&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/python-reverse-list.220302c8f5a4.gif&quot; width=&quot;400&quot; height=&quot;150&quot; srcset=&quot;https://files.realpython.com/media/python-reverse-list.220302c8f5a4.gif 100w, https://files.realpython.com/media/python-reverse-list.220302c8f5a4.gif 200w, https://files.realpython.com/media/python-reverse-list.220302c8f5a4.gif 400w&quot; sizes=&quot;75vw&quot; alt=&quot;Reverse Lists in Python&quot; data-asset=&quot;3582&quot;&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;To translate this process into code, you can use a &lt;a href=&quot;https://realpython.com/python-for-loop/&quot;&gt;&lt;code&gt;for&lt;/code&gt; loop&lt;/a&gt; with a &lt;a href=&quot;https://realpython.com/python-range/&quot;&gt;&lt;code&gt;range&lt;/code&gt;&lt;/a&gt; object over the first half of the list, which you can get with &lt;code&gt;len(digits) // 2&lt;/code&gt;. Then you can use a parallel assignment statement to swap the elements, like this:&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;n&quot;&gt;digits&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;mi&quot;&gt;0&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;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&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;mi&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;len&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;digits&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&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;gp&quot;&gt;... &lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;digits&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;digits&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;digits&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;digits&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;...&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;digits&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]&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-reverse-list/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-reverse-list/ »&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 #66: Practicing Python With CSV Files and Extracting Values With &quot;filter()&quot;</title>
      <id>https://realpython.com/podcasts/rpp/66/</id>
      <link href="https://realpython.com/podcasts/rpp/66/"/>
      <updated>2021-06-25T12:00:00+00:00</updated>
      <summary>Are you ready to practice your Python skills some more? There is a new set of practice problems prepared for you to tackle, and this time they&#x27;re based on working with CSV files. This week on the show, David Amos is back, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;Are you ready to practice your Python skills some more? There is a new set of practice problems prepared for you to tackle, and this time they&#x27;re based on working with CSV files. This week on the show, David Amos is back, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.&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>CPython Internals: Paperback Now Available!</title>
      <id>https://realpython.com/cpython-internals-paperback/</id>
      <link href="https://realpython.com/cpython-internals-paperback/"/>
      <updated>2021-06-23T14:00:00+00:00</updated>
      <summary>After almost two years of writing, reviewing, and testing, we&#x27;re delighted to announce that CPython Internals: Your Guide to the Python 3 Interpreter is available in paperback! In this article, you&#x27;ll see how the book can help you take your Python skills to the next level.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;After almost two years of writing, reviewing, and testing, we’re delighted to announce that &lt;em&gt;CPython Internals: Your Guide to the Python 3 Interpreter&lt;/em&gt; is now available in paperback!&lt;/p&gt;
&lt;p&gt;Are there certain parts of Python that just seem like magic? Once you see how Python works at the interpreter level, you’ll be able to optimize your applications and fully leverage the power of Python.&lt;/p&gt;
&lt;p&gt;In &lt;em&gt;CPython Internals&lt;/em&gt;, you’ll unlock the &lt;strong&gt;inner workings&lt;/strong&gt; of the Python language, learn how to &lt;strong&gt;compile&lt;/strong&gt; the Python &lt;strong&gt;interpreter&lt;/strong&gt; from &lt;strong&gt;source code&lt;/strong&gt;, and cover what you’ll need to know to confidently start &lt;strong&gt;contributing to CPython&lt;/strong&gt; yourself!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this article, you’ll see:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How you can take your Python skills to the &lt;strong&gt;next level&lt;/strong&gt; with &lt;em&gt;CPython Internals&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;How other Pythonistas have &lt;strong&gt;already&lt;/strong&gt; been doing it&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To skip right to the good stuff and get your hands on the book, click the link below:&lt;/p&gt;
&lt;div class=&quot;text-center my-4&quot;&gt;
  &lt;a href=&quot;https://realpython.com/asins/1775093344/&quot; class=&quot;btn btn-lg btn-primary px-5&quot;&gt;Buy on &lt;strong&gt;Amazon&lt;/strong&gt; »&lt;/a&gt;
&lt;/div&gt;

&lt;h2 id=&quot;you-can-get-cpython-internals-in-paperback&quot;&gt;You Can Get CPython Internals in Paperback!&lt;a class=&quot;headerlink&quot; href=&quot;#you-can-get-cpython-internals-in-paperback&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;It’s finally here! Readers have been showing us their copies and letting us know what they think:&lt;/p&gt;
&lt;figure&gt;&lt;a href=&quot;https://files.realpython.com/media/CPython_cover.d957adbf1a7c.jpg&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/CPython_cover.d957adbf1a7c.jpg&quot; width=&quot;2000&quot; height=&quot;1125&quot; srcset=&quot;https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/CPython_cover.d957adbf1a7c.jpg&amp;amp;w=500&amp;amp;sig=e24d7258b7c5fb6b9e20fc9ed4e71b7be7c685cd 500w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/CPython_cover.d957adbf1a7c.jpg&amp;amp;w=1000&amp;amp;sig=4368c619b9561abb3ee6744ed4908fb6d25e1403 1000w, https://files.realpython.com/media/CPython_cover.d957adbf1a7c.jpg 2000w&quot; sizes=&quot;75vw&quot; alt=&quot;Front cover of CPython Internals: Your Guide to the Python 3 Interpreter&quot; data-asset=&quot;3776&quot;&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;This book is a sort of “missing manual” for CPython’s internals, and we’re looking forward to the Python community getting tons of knowledge and skills from this unique resource. We’re delighted with the final product, so here’s the author, Anthony Shaw, to walk you through the paperback version of the book:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/cpython-internals-paperback/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/cpython-internals-paperback/ »&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>Python vs JavaScript for Python Developers</title>
      <id>https://realpython.com/courses/python-vs-javascript-for-python-devs/</id>
      <link href="https://realpython.com/courses/python-vs-javascript-for-python-devs/"/>
      <updated>2021-06-22T14:00:00+00:00</updated>
      <summary>Python and JavaScript are two of the most popular programming languages in the world. In this course, you&#x27;ll take a deep dive into the JavaScript ecosystem by comparing Python vs JavaScript. You&#x27;ll learn the jargon, language history, and best practices from a Pythonista&#x27;s perspective.</summary>
      <content type="html">
        &lt;p&gt;Python isn&amp;rsquo;t the only language out there, and one of the other languages frequently fighting Python for the top of the &amp;ldquo;most popular&amp;rdquo; lists is &lt;strong&gt;JavaScript&lt;/strong&gt;. JavaScript is the de facto language on the web but also has a robust toolset on the server side. This course explores JavaScript from a Python programmer&amp;rsquo;s perspective.&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;ve never used JavaScript before or have felt overwhelmed by the quick pace of its evolution in recent years, then this course will set you on the right path. You should already know the &lt;a href=&quot;https://realpython.com/products/python-basics-book/&quot;&gt;basics of Python&lt;/a&gt; to benefit fully from the comparisons made between the two languages.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you will learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Where JavaScript comes from and where it is used&lt;/li&gt;
&lt;li&gt;How JavaScript&amp;rsquo;s &lt;strong&gt;type system&lt;/strong&gt; is different from Python&amp;rsquo;s&lt;/li&gt;
&lt;li&gt;How to write &lt;strong&gt;functions&lt;/strong&gt; in JavaScript&lt;/li&gt;
&lt;li&gt;The two ways of creating &lt;strong&gt;objects&lt;/strong&gt; in JavaScript&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;General language syntax&lt;/strong&gt; in JavaScript&lt;/li&gt;
&lt;li&gt;Surprises and behaviors in JavaScript that Python programmers wouldn&amp;rsquo;t expect&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 #65: Expanding the International Python Community With the PSF</title>
      <id>https://realpython.com/podcasts/rpp/65/</id>
      <link href="https://realpython.com/podcasts/rpp/65/"/>
      <updated>2021-06-18T12:00:00+00:00</updated>
      <summary>The popularity of Python is continuing to grow Developers across the globe are embracing the language. How is Python being used in all of these different countries? How does an organization like the Python Software Foundation (PSF) work toward the goals in its mission statement for supporting and growing this international community? This week on the show, we have Marlene Mhangami, a PSF board member and part of the Diversity and Inclusion Work Group.</summary>
      <content type="html">
        &lt;p&gt;The popularity of Python is continuing to grow Developers across the globe are embracing the language. How is Python being used in all of these different countries? How does an organization like the Python Software Foundation (PSF) work toward the goals in its mission statement for supporting and growing this international community? This week on the show, we have Marlene Mhangami, a PSF board member and part of the Diversity and Inclusion Work Group.&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>Using Pandas to Make a Gradebook in Python</title>
      <id>https://realpython.com/courses/gradebook-using-pandas-python/</id>
      <link href="https://realpython.com/courses/gradebook-using-pandas-python/"/>
      <updated>2021-06-15T14:00:00+00:00</updated>
      <summary>With this Python project, you&#x27;ll build a script to calculate grades for a class using pandas. The script will quickly and accurately calculate grades from a variety of data sources. You&#x27;ll see examples of loading, merging, and saving data with pandas, as well as plotting some summary statistics.</summary>
      <content type="html">
        &lt;p&gt;One of the jobs that all teachers have in common is &lt;strong&gt;evaluating students&lt;/strong&gt;. Whether you use exams, homework assignments, quizzes, or projects, you usually have to turn students&amp;rsquo; scores into a &lt;strong&gt;letter grade&lt;/strong&gt; at the end of the term. This often involves a bunch of calculations that you might do in a spreadsheet. Instead, you can consider using Python and &lt;a href=&quot;https://realpython.com/pandas-python-explore-dataset/&quot;&gt;pandas&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll learn how to&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Load&lt;/strong&gt; and &lt;strong&gt;merge&lt;/strong&gt; data from multiple sources with pandas&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Filter&lt;/strong&gt; and &lt;strong&gt;group&lt;/strong&gt; data in a pandas DataFrame&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Calculate&lt;/strong&gt; and &lt;strong&gt;plot&lt;/strong&gt; grades in a pandas DataFrame&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 #64: Detecting Deforestation With Python &amp; Using GraphQL With Django and Vue</title>
      <id>https://realpython.com/podcasts/rpp/64/</id>
      <link href="https://realpython.com/podcasts/rpp/64/"/>
      <updated>2021-06-11T12:00:00+00:00</updated>
      <summary>Are you looking for an in-depth data science project to practice your skills on? Perhaps you would like to add new tools to your Python web development projects instead? This week on the show, David Amos is back, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;Are you looking for an in-depth data science project to practice your skills on? Perhaps you would like to add new tools to your Python web development projects instead? This week on the show, David Amos is back, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.&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 Basics: Setting Up Python</title>
      <id>https://realpython.com/courses/setting-up-python/</id>
      <link href="https://realpython.com/courses/setting-up-python/"/>
      <updated>2021-06-08T14:00:00+00:00</updated>
      <summary>The first step to getting started with Python is to set it up on your machine. In this course, you&#x27;ll learn how to download Python for Windows, macOS, and Ubuntu Linux and how to open Python&#x27;s Integrated Development and Learning Environment, IDLE.</summary>
      <content type="html">
        &lt;p&gt;Setting up Python is the first step to becoming a Python programmer. In this course, you&amp;rsquo;ll learn how to download and install Python for Windows, macOS, and Ubuntu Linux and how to open &lt;strong&gt;Python&amp;rsquo;s Integrated Development and Learning Environment, IDLE&lt;/strong&gt;. &lt;/p&gt;
&lt;p&gt;There are many ways to install Python. You can download official Python distributions from &lt;a href=&quot;https://python.org&quot;&gt;Python.org&lt;/a&gt;, install from a package manager, and even install specialized distributions for scientific computing, Internet of Things, and embedded systems. This course focuses on official distributions, as they&amp;rsquo;re generally the best option for getting started with learning to program in Python.&lt;/p&gt;
&lt;p&gt;This course can be enjoyed alone or as an accompaniment to &lt;a href=&quot;http://pythonbasicsbook.com&quot;&gt;Python Basics: A Practical Introduction to Python 3&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll learn how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Install Python on &lt;strong&gt;Windows&lt;/strong&gt;, &lt;strong&gt;macOS&lt;/strong&gt;, and &lt;strong&gt;Linux&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Open &lt;strong&gt;IDLE&lt;/strong&gt;, Python&amp;rsquo;s integrated development and learning environment&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 #63: Create Web Applications Using Only Python With Anvil</title>
      <id>https://realpython.com/podcasts/rpp/63/</id>
      <link href="https://realpython.com/podcasts/rpp/63/"/>
      <updated>2021-06-04T12:00:00+00:00</updated>
      <summary>What if you could create an application and deploy it to the web with just Python? Wouldn&#x27;t it be nice to skip the additional full-stack development steps of learning three different languages in addition to Python? That&#x27;s the idea behind Anvil. This week on the show, we have Meredydd Luff, co-founder of Anvil.</summary>
      <content type="html">
        &lt;p&gt;What if you could create an application and deploy it to the web with just Python? Wouldn&#x27;t it be nice to skip the additional full-stack development steps of learning three different languages in addition to Python? That&#x27;s the idea behind Anvil. This week on the show, we have Meredydd Luff, co-founder of Anvil.&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>Explore Your Dataset With Pandas</title>
      <id>https://realpython.com/courses/explore-dataset-with-pandas/</id>
      <link href="https://realpython.com/courses/explore-dataset-with-pandas/"/>
      <updated>2021-06-01T14:00:00+00:00</updated>
      <summary>In this step-by-step course, you&#x27;ll learn how to start exploring a dataset with Pandas and Python. You&#x27;ll learn how to access specific rows and columns to answer questions about your data. You&#x27;ll also see how to handle missing values and prepare to visualize your dataset in a Jupyter Notebook.</summary>
      <content type="html">
        &lt;p&gt;Do you have a large dataset that&amp;rsquo;s full of interesting insights, but you&amp;rsquo;re not sure where to start exploring it? Has your boss asked you to generate some &lt;a href=&quot;https://realpython.com/python-statistics/&quot;&gt;statistics&lt;/a&gt; from it, but they&amp;rsquo;re not so easy to extract? These are precisely the use cases where &lt;strong&gt;Pandas&lt;/strong&gt; and Python can help you! With these tools, you&amp;rsquo;ll be able to slice a large dataset down into manageable parts and glean insight from that information.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll learn how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Calculate&lt;/strong&gt; metrics about your data&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Perform&lt;/strong&gt; basic queries and aggregations&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Discover&lt;/strong&gt; and handle incorrect data, inconsistencies, and missing values&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Visualize&lt;/strong&gt; your data with plots&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You&amp;rsquo;ll also learn about the differences between the main &lt;a href=&quot;https://realpython.com/python-data-structures/&quot;&gt;data structures&lt;/a&gt; that Pandas and Python use.&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 Real Python Podcast – Episode #62: Selecting the Ideal Data Structure &amp; Unravelling Python&#x27;s &quot;pass&quot; and &quot;with&quot;</title>
      <id>https://realpython.com/podcasts/rpp/62/</id>
      <link href="https://realpython.com/podcasts/rpp/62/"/>
      <updated>2021-05-28T12:00:00+00:00</updated>
      <summary>How do you know you&#x27;re using the correct data structure for your Python project? There are so many built into Python and even more that are importable from the collections module. This week on the show, David Amos is back, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects. We discuss a recent three-part video course on selecting the ideal data structure.</summary>
      <content type="html">
        &lt;p&gt;How do you know you&#x27;re using the correct data structure for your Python project? There are so many built into Python and even more that are importable from the collections module. This week on the show, David Amos is back, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects. We discuss a recent three-part video course on selecting the ideal data structure.&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 Set Up a Django Project</title>
      <id>https://realpython.com/courses/set-up-django-project/</id>
      <link href="https://realpython.com/courses/set-up-django-project/"/>
      <updated>2021-05-25T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll learn the necessary steps you&#x27;ll need to take to set up a new Django project. You&#x27;ll learn the basic setup for any new Django project that needs to happen before programming the specific functionality of your project.</summary>
      <content type="html">
        &lt;p&gt;When you start building any new Django web application, there&amp;rsquo;s a basic setup you need to tackle first. This course outlines the &lt;strong&gt;necessary steps to set up a Django project&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;During this course, you&amp;rsquo;ll focus on the initial steps you&amp;rsquo;ll need to take to start a new web application. You should first have Python installed and you should know how to work with virtual environments and Python&amp;rsquo;s package manager, &lt;code&gt;pip&lt;/code&gt;. You won&amp;rsquo;t need much programming knowledge to follow along with this setup, though you&amp;rsquo;ll need to know some Python to develop your project further afterwards.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;After finishing this course, you&amp;rsquo;ll know how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Set up a &lt;strong&gt;virtual environment&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Install&lt;/strong&gt; Django&lt;/li&gt;
&lt;li&gt;Pin your &lt;strong&gt;project dependencies&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Set up a Django &lt;strong&gt;project&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Start a Django &lt;strong&gt;app&lt;/strong&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 #61: Scaling Data Science and Machine Learning Infrastructure Like Netflix</title>
      <id>https://realpython.com/podcasts/rpp/61/</id>
      <link href="https://realpython.com/podcasts/rpp/61/"/>
      <updated>2021-05-21T12:00:00+00:00</updated>
      <summary>Would you move your data science project from a laptop to the cloud? Would you also like to have snapshots of your project saved along the way so that you can go back in time or share the state of your project with another team member? This week on the show, we have Savin Goyal from Netflix. Savin is the technical lead for machine learning infrastructure at Netflix. He joins us to talk about Metaflow, an open-source tool to simplify building, managing, and scaling data science projects.</summary>
      <content type="html">
        &lt;p&gt;Would you move your data science project from a laptop to the cloud? Would you also like to have snapshots of your project saved along the way so that you can go back in time or share the state of your project with another team member? This week on the show, we have Savin Goyal from Netflix. Savin is the technical lead for machine learning infrastructure at Netflix. He joins us to talk about Metaflow, an open-source tool to simplify building, managing, and scaling data science projects.&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>
  

</feed>
