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

  
    <entry>
      <title>Dependency Management With Python Poetry</title>
      <id>https://realpython.com/dependency-management-python-poetry/</id>
      <link href="https://realpython.com/dependency-management-python-poetry/"/>
      <updated>2024-02-19T14:00:00+00:00</updated>
      <summary>Learn how Python Poetry will help you start new projects, maintain existing ones, and master dependency management.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;When your Python project relies on external packages, you need to make sure you’re using the right version of each package. After an update, a package might not work as it did before. A &lt;strong&gt;dependency manager&lt;/strong&gt; like Python Poetry helps you specify, install, and resolve external packages in your projects. This way, you can be sure that you always work with the correct dependency version on every machine.&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;Create a &lt;strong&gt;new project&lt;/strong&gt; using Poetry&lt;/li&gt;
&lt;li&gt;Add Poetry to an &lt;strong&gt;existing project&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Configure your project through &lt;strong&gt;&lt;code&gt;pyproject.toml&lt;/code&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Pin your project’s &lt;strong&gt;dependency versions&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Install dependencies from a &lt;strong&gt;&lt;code&gt;poetry.lock&lt;/code&gt;&lt;/strong&gt; file&lt;/li&gt;
&lt;li&gt;Run basic Poetry commands using the &lt;strong&gt;Poetry CLI&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&quot;https://python-poetry.org/&quot;&gt;Poetry&lt;/a&gt; helps you create new projects or maintain existing projects while taking care of &lt;strong&gt;dependency management&lt;/strong&gt; for you. It uses the &lt;code&gt;pyproject.toml&lt;/code&gt; file, which has become the standard for defining build requirements in modern Python projects.&lt;/p&gt;
&lt;p&gt;To complete this tutorial and get the most out of it, you should have a basic understanding of &lt;a href=&quot;https://realpython.com/python-virtual-environments-a-primer/&quot;&gt;virtual environments&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-modules-packages/&quot;&gt;modules and packages&lt;/a&gt;, and &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;p&gt;While you’ll focus on dependency management in this tutorial, Poetry can also help you &lt;a href=&quot;https://python-poetry.org/docs/cli/#build&quot;&gt;build a distribution package&lt;/a&gt; for your project. If you want to share your work, then you can use Poetry to &lt;a href=&quot;https://python-poetry.org/docs/cli/#publish&quot;&gt;publish&lt;/a&gt; your project on the &lt;a href=&quot;https://pypi.org/&quot;&gt;Python Packaging Index (PyPI)&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-dependency-pitfalls-email-course&quot; data-focus=&quot;false&quot;&gt;Click here to get access to a free 5-day class&lt;/a&gt; that shows you how to avoid common dependency management issues with tools like Pip, PyPI, Virtualenv, and requirements files.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;take-care-of-prerequisites&quot;&gt;Take Care of Prerequisites&lt;a class=&quot;headerlink&quot; href=&quot;#take-care-of-prerequisites&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Before diving into the nitty-gritty of Python Poetry, you’ll take care of some prerequisites. First, you’ll read a short overview of the terminology that you’ll encounter in this tutorial. Next, you’ll install Poetry itself.&lt;/p&gt;
&lt;h3 id=&quot;learn-the-relevant-terminology&quot;&gt;Learn the Relevant Terminology&lt;a class=&quot;headerlink&quot; href=&quot;#learn-the-relevant-terminology&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;If you’ve ever used an &lt;a href=&quot;https://realpython.com/python-import/&quot;&gt;&lt;code&gt;import&lt;/code&gt; statement&lt;/a&gt; in one of your Python scripts, then you’ve worked with &lt;strong&gt;modules&lt;/strong&gt; and &lt;strong&gt;packages&lt;/strong&gt;. Some of them might have been Python files you wrote on your own. Others could’ve been &lt;strong&gt;standard library modules&lt;/strong&gt; that ship with Python, like &lt;a href=&quot;https://realpython.com/python-datetime/&quot;&gt;&lt;code&gt;datetime&lt;/code&gt;&lt;/a&gt;. However, sometimes, what Python provides isn’t enough. That’s when you might turn to external modules and packages maintained by third parties.&lt;/p&gt;
&lt;p&gt;When your Python code relies on such external modules and packages, they become the &lt;strong&gt;requirements&lt;/strong&gt; or &lt;strong&gt;dependencies&lt;/strong&gt; of your project.&lt;/p&gt;
&lt;p&gt;To find packages contributed by the Python community that aren’t part of the &lt;a href=&quot;https://docs.python.org/3/py-modindex.html&quot;&gt;Python standard library&lt;/a&gt;, you can browse &lt;a href=&quot;https://pypi.org/&quot;&gt;PyPI&lt;/a&gt;. Once you’ve found a package you’re interested in, you can use Poetry to manage and install that package in your project. Before seeing how this works, you need to install Poetry on your system.&lt;/p&gt;
&lt;h3 id=&quot;install-poetry-on-your-computer&quot;&gt;Install Poetry on Your Computer&lt;a class=&quot;headerlink&quot; href=&quot;#install-poetry-on-your-computer&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Poetry is distributed as a &lt;a href=&quot;https://pypi.org/project/poetry/&quot;&gt;Python package itself&lt;/a&gt;, which means that you can install it into a virtual environment using &lt;code&gt;pip&lt;/code&gt;, just like any other external package:&lt;/p&gt;
&lt;ul class=&quot;nav nav-tabs justify-content-end js-platform-widget-tabs&quot; role=&quot;tablist&quot;&gt;

  &lt;li class=&quot;nav-item mb-0 js-platform-widget-tab-windows&quot; role=&quot;presentation&quot;&gt;
    &lt;a class=&quot;nav-link link-unstyled text-body active small&quot; id=&quot;windows-tab-1&quot; data-toggle=&quot;tab&quot; href=&quot;#windows-1&quot; role=&quot;tab&quot; aria-controls=&quot;windows-1&quot; aria-selected=&quot;true&quot;&gt;&lt;span class=&quot;icon baseline text-muted mr-1&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#brands--windows&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Windows&lt;/a&gt;
  &lt;/li&gt;




  &lt;li class=&quot;nav-item mb-0 js-platform-widget-tab-linuxmacos&quot; role=&quot;presentation&quot;&gt;
    &lt;a class=&quot;nav-link link-unstyled text-body small&quot; id=&quot;macos-tab-1&quot; data-toggle=&quot;tab&quot; href=&quot;#linux-macos-1&quot; role=&quot;tab&quot; aria-controls=&quot;linux-macos-1&quot; aria-selected=&quot;false&quot;&gt;&lt;span class=&quot;icon baseline text-muted&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#v4--linux&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;span class=&quot;icon baseline text-muted mr-1&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#v4--apple&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Linux + macOS&lt;/a&gt;
  &lt;/li&gt;

&lt;/ul&gt;
&lt;div class=&quot;tab-content mt-2 mb-0 js-platform-widget-content&quot;&gt;
&lt;div aria-labelledby=&quot;windows-tab-1&quot; class=&quot;tab-pane fade show active&quot; id=&quot;windows-1&quot; role=&quot;tabpanel&quot;&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pscon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Windows PowerShell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;PS&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;python&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;-m&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pip&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;poetry&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div aria-labelledby=&quot;linux-macos-tab-1&quot; class=&quot;tab-pane fade &quot; id=&quot;linux-macos-1&quot; role=&quot;tabpanel&quot;&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python3&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;-m&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;pip&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;install&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;poetry
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This is fine if you just want to quickly try it out. However, the &lt;a href=&quot;https://python-poetry.org/docs/&quot;&gt;official documentation&lt;/a&gt; strongly advises &lt;em&gt;against&lt;/em&gt; installing Poetry into your project’s virtual environment, which the tool must manage. Because Poetry depends on several external packages itself, you’d run the risk of a &lt;strong&gt;dependency conflict&lt;/strong&gt; between one of your project’s dependencies and those required by Poetry. In turn, this could cause Poetry or your code to malfunction.&lt;/p&gt;
&lt;p&gt;In practice, you always want to keep Poetry separate from any virtual environment that you create for your Python projects. You also want to install Poetry &lt;strong&gt;system-wide&lt;/strong&gt; to access it as a stand-alone application regardless of the specific virtual environment or Python version that you’re currently working in.&lt;/p&gt;
&lt;p&gt;There are several ways to get Poetry running on your computer, including:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;A tool called &lt;code&gt;pipx&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;The official installer&lt;/li&gt;
&lt;li&gt;Manual installation&lt;/li&gt;
&lt;li&gt;Pre-built system packages&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In most cases, the &lt;em&gt;recommended way to install Poetry&lt;/em&gt; is with the help of &lt;code&gt;pipx&lt;/code&gt;, which takes care of creating and maintaining isolated virtual environments for command-line Python applications. After &lt;a href=&quot;https://pipx.pypa.io/stable/installation/&quot;&gt;installing &lt;code&gt;pipx&lt;/code&gt;&lt;/a&gt;, you can install Poetry by issuing the following command in your terminal window:&lt;/p&gt;
&lt;ul class=&quot;nav nav-tabs justify-content-end js-platform-widget-tabs&quot; role=&quot;tablist&quot;&gt;

  &lt;li class=&quot;nav-item mb-0 js-platform-widget-tab-windows&quot; role=&quot;presentation&quot;&gt;
    &lt;a class=&quot;nav-link link-unstyled text-body active small&quot; id=&quot;windows-tab-2&quot; data-toggle=&quot;tab&quot; href=&quot;#windows-2&quot; role=&quot;tab&quot; aria-controls=&quot;windows-2&quot; aria-selected=&quot;true&quot;&gt;&lt;span class=&quot;icon baseline text-muted mr-1&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#brands--windows&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Windows&lt;/a&gt;
  &lt;/li&gt;




  &lt;li class=&quot;nav-item mb-0 js-platform-widget-tab-linuxmacos&quot; role=&quot;presentation&quot;&gt;
    &lt;a class=&quot;nav-link link-unstyled text-body small&quot; id=&quot;macos-tab-2&quot; data-toggle=&quot;tab&quot; href=&quot;#linux-macos-2&quot; role=&quot;tab&quot; aria-controls=&quot;linux-macos-2&quot; aria-selected=&quot;false&quot;&gt;&lt;span class=&quot;icon baseline text-muted&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#v4--linux&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;span class=&quot;icon baseline text-muted mr-1&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#v4--apple&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Linux + macOS&lt;/a&gt;
  &lt;/li&gt;

&lt;/ul&gt;
&lt;div class=&quot;tab-content mt-2 mb-0 js-platform-widget-content&quot;&gt;
&lt;div aria-labelledby=&quot;windows-tab-2&quot; class=&quot;tab-pane fade show active&quot; id=&quot;windows-2&quot; role=&quot;tabpanel&quot;&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pscon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Windows PowerShell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;PS&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pipx&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;poetry&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div aria-labelledby=&quot;linux-macos-tab-2&quot; class=&quot;tab-pane fade &quot; id=&quot;linux-macos-2&quot; role=&quot;tabpanel&quot;&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;pipx&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;install&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;poetry
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;While this command looks very similar to the one you saw previously, it’ll install Poetry into a dedicated virtual environment that won’t be shared with other Python packages.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/dependency-management-python-poetry/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/dependency-management-python-poetry/ »&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 #192: Practical Python Decorator Uses &amp; Avoiding datetime Pitfalls</title>
      <id>https://realpython.com/podcasts/rpp/192/</id>
      <link href="https://realpython.com/podcasts/rpp/192/"/>
      <updated>2024-02-16T12:00:00+00:00</updated>
      <summary>What are real-life examples of using Python decorators? How can you harness their power in your code? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;What are real-life examples of using Python decorators? How can you harness their power in your code? Christopher Trudeau is back on the show this week, bringing 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>BNF Notation: Dive Deeper Into Python&#x27;s Grammar</title>
      <id>https://realpython.com/python-bnf-notation/</id>
      <link href="https://realpython.com/python-bnf-notation/"/>
      <updated>2024-02-14T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn about Backus–Naur form notation (BNF), which is typically used for defining the grammar of programming languages. Python uses a variation of BNF, and here, you&#x27;ll learn how to read it to get a better understanding of some language constructs.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;While reading the Python documentation, you may have found fragments of BNF notation (&lt;a href=&quot;https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form&quot;&gt;Backus–Naur form&lt;/a&gt;) that look something like the following:&lt;/p&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;abnf&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--grey&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;BNF Grammar&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;nc&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;      &lt;/span&gt;::&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;lc_&lt;span class=&quot;nc&quot;&gt;letter&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;lc_&lt;span class=&quot;nc&quot;&gt;letter&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;|&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;l&quot;&gt;&quot;_&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;
lc_&lt;span class=&quot;nc&quot;&gt;letter&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;::&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;l&quot;&gt;&quot;a&quot;&lt;/span&gt;...&lt;span class=&quot;l&quot;&gt;&quot;z&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;What’s the meaning of all this strange code? How can this help you in understanding Python concepts? How can you read and interpret this notation?&lt;/p&gt;
&lt;p&gt;In this tutorial, you’ll get to know the basics of Python’s BNF notation and learn how to take advantage of it to get a deep understanding of the language’s syntax and grammar.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Learn what &lt;strong&gt;BNF notation&lt;/strong&gt; is and what it’s used for&lt;/li&gt;
&lt;li&gt;Explore the characteristics of &lt;strong&gt;Python’s BNF variation&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Learn how to &lt;strong&gt;read&lt;/strong&gt; the BNF notation in the Python documentation&lt;/li&gt;
&lt;li&gt;Explore some &lt;strong&gt;best practices&lt;/strong&gt; for reading Python’s BNF notation&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To get the most out of this tutorial, you should be familiar with Python syntax, including &lt;a href=&quot;https://realpython.com/python-keywords/&quot;&gt;keywords&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-operators-expressions/&quot;&gt;operators&lt;/a&gt;, and some common constructs like expressions, &lt;a href=&quot;https://realpython.com/python-conditional-statements/&quot;&gt;conditional&lt;/a&gt; statements, and &lt;a href=&quot;https://realpython.com/python-for-loop/&quot;&gt;loops&lt;/a&gt;.&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 Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-bnf-notation-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-bnf-notation-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to download the free sample code&lt;/a&gt; that shows you how to read Python’s BNF notation.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;getting-to-know-backus-naur-form-notation-bnf&quot;&gt;Getting to Know Backus-Naur Form Notation (BNF)&lt;a class=&quot;headerlink&quot; href=&quot;#getting-to-know-backus-naur-form-notation-bnf&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The &lt;a href=&quot;https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form&quot;&gt;Backus–Naur form&lt;/a&gt; or &lt;strong&gt;Backus normal form&lt;/strong&gt; (&lt;strong&gt;BNF&lt;/strong&gt;) is a &lt;a href=&quot;https://en.wikipedia.org/wiki/Metasyntax&quot;&gt;metasyntax&lt;/a&gt; notation for &lt;a href=&quot;https://en.wikipedia.org/wiki/Context-free_grammar&quot;&gt;context-free grammars&lt;/a&gt;. Computer scientists often use this notation to describe the syntax of programming languages because it allows them to write a detailed description of a language’s grammar.&lt;/p&gt;
&lt;p&gt;The BNF notation consists of three core pieces:&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;Component&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Examples&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Terminal_and_nonterminal_symbols#Terminal_symbols&quot;&gt;Terminals&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Strings that must exactly match specific items in the input.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&quot;def&quot;&lt;/code&gt;, &lt;code&gt;&quot;return&quot;&lt;/code&gt;, &lt;code&gt;&quot;:&quot;&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Terminal_and_nonterminal_symbols#Nonterminal_symbols&quot;&gt;Nonterminals&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Symbols that will be replaced by a concrete value. They may also be called simply &lt;strong&gt;syntactic variables&lt;/strong&gt;.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;letter&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;digit&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Terminal_and_nonterminal_symbols#Production_rules&quot;&gt;Rules&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Conventions of terminals and nonterminals that define how these elements relate.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;letter&amp;gt; ::= &quot;a&quot;&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;By combining terminals and nonterminals, you can create &lt;strong&gt;BNF rules&lt;/strong&gt;, which can get as detailed as you need. Nonterminals must have their own defining rules. In a piece of grammar, you’ll have a root rule and potentially many secondary rules that define the required nonterminals. This way, you may end up with a hierarchy of rules.&lt;/p&gt;
&lt;p&gt;BNF rules are the core components of a BNF grammar. So, a &lt;strong&gt;grammar&lt;/strong&gt; is a set of BNF rules that are also called &lt;strong&gt;production rules&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;In practice, you can build a set of BNF rules to specify the grammar of a language. Here, &lt;strong&gt;language&lt;/strong&gt; refers to a set of strings that are valid according to the rules defined in the corresponding grammar. BNF is mainly used for &lt;a href=&quot;https://en.wikipedia.org/wiki/Programming_language&quot;&gt;programming languages&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For example, the Python syntax has a &lt;a href=&quot;https://docs.python.org/3/reference/grammar.html&quot;&gt;grammar&lt;/a&gt; that’s defined as a set of BNF rules, and these rules are used to validate the syntax of any piece of Python code. If the code doesn’t fulfill the rules, then you’ll get a &lt;a href=&quot;https://realpython.com/invalid-syntax-python/&quot;&gt;&lt;code&gt;SyntaxError&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You’ll find many variations of the original BNF notation out there. Some of the most relevant include the &lt;a href=&quot;https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form&quot;&gt;extended Backus–Naur form&lt;/a&gt; (EBNF) and &lt;a href=&quot;https://en.wikipedia.org/wiki/Augmented_Backus%E2%80%93Naur_form&quot;&gt;augmented Backus–Naur form&lt;/a&gt; (ABNF).&lt;/p&gt;
&lt;p&gt;In the following sections, you’ll learn the basics of creating BNF rules. Note that you’ll use a variation of BNF that matches the requirements of the &lt;a href=&quot;https://bnfplayground.pauliankline.com/&quot;&gt;BNF Playground&lt;/a&gt; site, which you’ll use for testing your rules.&lt;/p&gt;
&lt;h3 id=&quot;bnf-rules-and-their-components&quot;&gt;BNF Rules and Their Components&lt;a class=&quot;headerlink&quot; href=&quot;#bnf-rules-and-their-components&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;As you already learned, by combining terminals and nonterminals, you can create BNF rules. These rules typically follow the syntax below:&lt;/p&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;abnf&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--grey&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;BNF Grammar&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&amp;lt;&lt;span class=&quot;nc&quot;&gt;symbol&lt;/span&gt;&amp;gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;::&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;expression&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;In the BNF rule syntax, you have the following parts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Symbol&quot;&gt;&lt;code&gt;&amp;lt;symbol&amp;gt;&lt;/code&gt;&lt;/a&gt; is a nonterminal variable, which is often enclosed in angle brackets (&lt;code&gt;&amp;lt;&amp;gt;&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;::=&lt;/code&gt; means that the nonterminal on the left will be replaced with the expression on the right.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Expression_(mathematics)&quot;&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/a&gt; consists of a series of terminals, nonterminals, and other symbols that define a specific piece of grammar.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When building BNF rules, you can use a variety of symbols with specific meanings. For example, if you’re going to use the BNF Playground site to compile and test your rules, then you’ll find yourself using some of the following symbols:&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;Symbol&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&quot;&quot;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Encloses a terminal symbol&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Indicates a nonterminal symbol&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;()&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Indicates a group of valid options&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;+&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Specifies one or more of the previous element&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;*&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Specifies zero or more of the previous element&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;?&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Specifies zero or one occurrence of the previous element&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;|&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Indicates that you can select one of the options&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;[x-z]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Indicates letter or digit intervals&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-bnf-notation/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-bnf-notation/ »&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>Create Conway&#x27;s Game of Life With Python</title>
      <id>https://realpython.com/courses/conway-game-of-life-python/</id>
      <link href="https://realpython.com/courses/conway-game-of-life-python/"/>
      <updated>2024-02-13T14:00:00+00:00</updated>
      <summary>In this video course, you&#x27;ll use Python to build Conway&#x27;s Game of Life. You&#x27;ll implement a user-friendly command-line interface (CLI) with several options that will allow you to run the game using different life patterns and configurations.</summary>
      <content type="html">
        &lt;p&gt;Wouldn&amp;rsquo;t it be cool to build a Python game that only requires initial user input and then seems to take on a mind of its own, creating mesmerizing patterns along the way? You can do exactly that with &lt;a href=&quot;https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life&quot;&gt;Conway&amp;rsquo;s Game of Life&lt;/a&gt;, which is about the evolution of cells in a life grid.&lt;/p&gt;
&lt;p&gt;Implementing the Game of Life algorithm is a good exercise with many interesting challenges that you&amp;rsquo;ll have to figure out. Specifically, you&amp;rsquo;ll need to build the life grid and find a way to apply the game&amp;rsquo;s rules to all the cells on the grid so that they evolve through several generations.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this video course, you&amp;rsquo;ll:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Implement Conway&amp;rsquo;s &lt;strong&gt;Game of Life algorithm&lt;/strong&gt; with Python&lt;/li&gt;
&lt;li&gt;Build a &lt;strong&gt;&lt;code&gt;curses&lt;/code&gt; view&lt;/strong&gt; to display the Game of Life grid&lt;/li&gt;
&lt;li&gt;Create an &lt;strong&gt;&lt;code&gt;argparse&lt;/code&gt; command-line interface&lt;/strong&gt; for the game&lt;/li&gt;
&lt;li&gt;Set up the game app for &lt;strong&gt;installation&lt;/strong&gt; and &lt;strong&gt;execution&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To get the most out of this video course, you should know the basics of writing &lt;a href=&quot;https://realpython.com/python3-object-oriented-programming/&quot;&gt;object-oriented code&lt;/a&gt; in Python, creating command-line interface (CLI) apps with &lt;a href=&quot;https://realpython.com/command-line-interfaces-python-argparse/&quot;&gt;&lt;code&gt;argparse&lt;/code&gt;&lt;/a&gt;, and setting up a Python project.&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>Primer on Python Decorators</title>
      <id>https://realpython.com/primer-on-python-decorators/</id>
      <link href="https://realpython.com/primer-on-python-decorators/"/>
      <updated>2024-02-12T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll look at what Python decorators are and how you define and use them. Decorators can make your code more readable and reusable. Come take a look at how decorators work under the hood and practice writing your own decorators.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;In this tutorial on Python decorators, you’ll learn what they are and how to create and use them. Decorators provide a simple syntax for calling &lt;a href=&quot;http://en.wikipedia.org/wiki/Higher-order_function&quot;&gt;higher-order functions&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;By definition, a decorator is a function that takes another function and extends the behavior of the latter function without explicitly modifying it. This sounds confusing, but it’ll make more sense after you’ve seen a few examples of how decorators work. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What it means for functions to be &lt;strong&gt;first-class objects&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to define functions so they can be used as &lt;strong&gt;decorators&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Which &lt;strong&gt;practical use cases&lt;/strong&gt; can be tackled with decorators&lt;/li&gt;
&lt;li&gt;How to create decorators so that they follow &lt;strong&gt;best practices&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can find all the examples from this tutorial by downloading the accompanying materials 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 Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/primer-on-python-decorators-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-primer-on-python-decorators-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to download the free sample code&lt;/a&gt; that shows you how to create and use Python decorators.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Free Bonus:&lt;/strong&gt; &lt;a href=&quot;&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-power-of-decorators-fixed&quot; data-focus=&quot;false&quot;&gt;Click here to get access to a free &quot;The Power of Python Decorators&quot; guide&lt;/a&gt; that shows you three advanced decorator patterns and techniques you can use to write cleaner and more Pythonic programs.&lt;/p&gt;&lt;/div&gt;

&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&gt;Decorators Cheat Sheet:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/decorators-cheatsheet/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-decorators-cheatsheet&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to get access to a free three-page Python decorators cheat sheet&lt;/a&gt; that summarizes the techniques explained in this tutorial.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&gt;Decorators Q&amp;amp;A Transcript:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/decorators-qa-2019/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-decorators-qa-2019&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to get access to a 25-page chat log from our Python decorators Q&amp;amp;A session&lt;/a&gt; in the Real Python Community Slack where we discussed common decorator questions.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
  &lt;p&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt; Test your knowledge with our interactive “Decorators” quiz. Upon completion you will receive a score so you can track your learning progress over time:&lt;/p&gt;
  &lt;p class=&quot;text-center my-2&quot;&gt;&lt;a class=&quot;btn btn-primary&quot; href=&quot;/quizzes/decorators/&quot; target=&quot;_blank&quot;&gt;Take the Quiz »&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;python-functions&quot;&gt;Python Functions&lt;a class=&quot;headerlink&quot; href=&quot;#python-functions&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In order to understand decorators, you must first understand some finer points of how functions work. There are many aspects to functions, but in the context of decorators, &lt;strong&gt;a function returns a value based on the given arguments&lt;/strong&gt;. Here’s a basic example:&lt;/p&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&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;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;add_one&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;number&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;number&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;add_one&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;go&quot;&gt;3&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;In general, functions in Python may also have side effects rather than just turning an input into an output. &lt;a href=&quot;https://realpython.com/python-print/&quot;&gt;The &lt;code&gt;print()&lt;/code&gt; function&lt;/a&gt; is an example of this: it &lt;a href=&quot;https://realpython.com/python-return-statement/&quot;&gt;returns&lt;/a&gt; &lt;a href=&quot;https://realpython.com/null-in-python/&quot;&gt;&lt;code&gt;None&lt;/code&gt;&lt;/a&gt; while having the side effect of outputting something to the console. However, to understand decorators, it’s enough to think about functions as tools that turn given arguments into values.&lt;/p&gt;
&lt;h3 id=&quot;first-class-objects&quot;&gt;First-Class Objects&lt;a class=&quot;headerlink&quot; href=&quot;#first-class-objects&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;In &lt;a href=&quot;https://realpython.com/python-functional-programming/&quot;&gt;functional programming&lt;/a&gt;, you work almost entirely with pure functions that don’t have side effects. While not a purely functional language, Python supports many functional programming concepts, including treating functions as &lt;a href=&quot;https://dbader.org/blog/python-first-class-functions&quot;&gt;first-class objects&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;This means that &lt;em&gt;functions can be passed around and used as arguments&lt;/em&gt;, just like &lt;a href=&quot;https://realpython.com/python-data-types/&quot;&gt;any other object like &lt;code&gt;str&lt;/code&gt;, &lt;code&gt;int&lt;/code&gt;, &lt;code&gt;float&lt;/code&gt;, &lt;code&gt;list&lt;/code&gt;, and so on&lt;/a&gt;. Consider the following three functions:&lt;/p&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;python&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    &lt;span class=&quot;mr-2&quot; aria-label=&quot;Filename&quot;&gt;&lt;code style=&quot;color: inherit;&quot;&gt;greeters.py&lt;/code&gt;&lt;/span&gt;
    &lt;div class=&quot;noselect&quot;&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;say_hello&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&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;sa&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Hello &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;be_awesome&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&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;sa&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Yo &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;, together we&#x27;re the awesomest!&quot;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;greet_bob&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;greeter_func&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;n&quot;&gt;greeter_func&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Bob&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Here, &lt;code&gt;say_hello()&lt;/code&gt; and &lt;code&gt;be_awesome()&lt;/code&gt; are regular functions that expect a name given as a string. The &lt;code&gt;greet_bob()&lt;/code&gt; function, however, expects a function as its argument. You can, for example, pass it the &lt;code&gt;say_hello()&lt;/code&gt; or the &lt;code&gt;be_awesome()&lt;/code&gt; function.&lt;/p&gt;
&lt;p&gt;To test your functions, you can run your code in interactive mode. You do this with the &lt;code&gt;-i&lt;/code&gt; flag. For example, if your code is in a file named &lt;code&gt;greeters.py&lt;/code&gt;, then you run &lt;code&gt;python -i greeters.py&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&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;greet_bob&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;say_hello&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&#x27;Hello Bob&#x27;&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;greet_bob&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;be_awesome&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&#x27;Yo Bob, together we&#x27;re the awesomest!&#x27;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Note that &lt;code&gt;greet_bob(say_hello)&lt;/code&gt; refers to two functions, but in different ways: &lt;code&gt;greet_bob()&lt;/code&gt; and &lt;code&gt;say_hello&lt;/code&gt;. The &lt;code&gt;say_hello&lt;/code&gt; function is named without parentheses. This means that only a reference to the function is passed. The function isn’t executed. The &lt;code&gt;greet_bob()&lt;/code&gt; function, on the other hand, is written with parentheses, so it will be called as usual.&lt;/p&gt;
&lt;p&gt;This is an important distinction that’s crucial for how functions work as first-class objects. A function name without parentheses is a reference to a function, while a function name with trailing parentheses calls the function and refers to its return value.&lt;/p&gt;
&lt;h3 id=&quot;inner-functions&quot;&gt;Inner Functions&lt;a class=&quot;headerlink&quot; href=&quot;#inner-functions&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;It’s possible to &lt;a href=&quot;https://realpython.com/defining-your-own-python-function/&quot;&gt;define functions&lt;/a&gt; &lt;em&gt;inside other functions&lt;/em&gt;. Such functions are called &lt;a href=&quot;https://realpython.com/inner-functions-what-are-they-good-for/&quot;&gt;inner functions&lt;/a&gt;. Here’s an example of a function with two inner functions:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/primer-on-python-decorators/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/primer-on-python-decorators/ »&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 #191: Focusing on Data Science &amp; Less on Engineering and Dependencies</title>
      <id>https://realpython.com/podcasts/rpp/191/</id>
      <link href="https://realpython.com/podcasts/rpp/191/"/>
      <updated>2024-02-09T12:00:00+00:00</updated>
      <summary>How do you manage the dependencies of a large-scale data science project? How do you migrate that project from a laptop to cloud infrastructure or utilize GPUs and multiple instances in parallel? This week on the show, Savin Goyal returns to discuss the updates to the open-source framework Metaflow.</summary>
      <content type="html">
        &lt;p&gt;How do you manage the dependencies of a large-scale data science project? How do you migrate that project from a laptop to cloud infrastructure or utilize GPUs and multiple instances in parallel? This week on the show, Savin Goyal returns to discuss the updates to the open-source framework Metaflow.&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 Write Beautiful Python Code With PEP 8</title>
      <id>https://realpython.com/python-pep8/</id>
      <link href="https://realpython.com/python-pep8/"/>
      <updated>2024-02-07T14:00:00+00:00</updated>
      <summary>Learn how to write high-quality, readable code by using the Python style guidelines laid out in PEP 8. Following these guidelines helps you make a great impression when sharing your work with potential employers and collaborators.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;PEP 8, sometimes spelled PEP8 or PEP-8, is a document that provides guidelines and best practices on &lt;em&gt;how&lt;/em&gt; to write Python code. It was written in 2001 by &lt;a href=&quot;https://en.wikipedia.org/wiki/Guido_van_Rossum&quot;&gt;Guido van Rossum&lt;/a&gt;, &lt;a href=&quot;https://barry.warsaw.us/&quot;&gt;Barry Warsaw&lt;/a&gt;, and &lt;a href=&quot;https://github.com/ncoghlan&quot;&gt;Alyssa Coghlan&lt;/a&gt;. The primary focus of PEP 8 is to improve the &lt;strong&gt;readability&lt;/strong&gt; and &lt;strong&gt;consistency&lt;/strong&gt; of Python code.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this tutorial, you’ll be able to&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Write Python code that &lt;strong&gt;conforms to PEP 8&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Understand the reasoning&lt;/strong&gt; behind the guidelines laid out in PEP 8&lt;/li&gt;
&lt;li&gt;Set up your development environment so that you can &lt;strong&gt;start writing PEP 8 compliant Python code&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;PEP stands for &lt;strong&gt;Python Enhancement Proposal&lt;/strong&gt;, and there are &lt;a href=&quot;https://peps.python.org/&quot;&gt;many PEPs&lt;/a&gt;. These documents primarily describe new features proposed for the Python language, but some PEPs also focus on design and style and aim to serve as a resource for the community. PEP 8 is one of these style-focused PEPs.&lt;/p&gt;
&lt;p&gt;In this tutorial, you’ll cover the key guidelines laid out in PEP 8. You’ll explore beginner to intermediate programming topics. You can learn about more advanced topics by reading the full &lt;a href=&quot;https://www.python.org/dev/peps/pep-0008/&quot;&gt;PEP 8&lt;/a&gt; documentation.&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 Your Code&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-pep8-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-pep8-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to download the free sample code&lt;/a&gt; that shows you how to write PEP 8 compliant code.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;why-we-need-pep-8&quot;&gt;Why We Need PEP 8&lt;a class=&quot;headerlink&quot; href=&quot;#why-we-need-pep-8&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;“Readability counts.”&lt;/p&gt;
&lt;p&gt;— The Zen of Python&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;PEP 8 exists to improve the readability of Python code. But why is readability so important? Why is writing readable code one of the guiding principles of the Python language, according to the &lt;a href=&quot;https://realpython.com/zen-of-python/&quot;&gt;Zen of Python&lt;/a&gt;?&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; You may encounter the term &lt;em&gt;Pythonic&lt;/em&gt; when the Python community refers to code that follows the idiomatic writing style specific to Python. &lt;a href=&quot;https://realpython.com/learning-paths/writing-pythonic-code/&quot;&gt;Pythonic code&lt;/a&gt; adheres to Python’s design principles and philosophy and emphasizes readability, simplicity, and clarity.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;As Guido van Rossum said, “Code is read much more often than it’s written.” You may spend a few minutes, or a whole day, writing a piece of code to process user authentication. Once you’ve written it, you’re never going to write it again.&lt;/p&gt;
&lt;p&gt;But you’ll definitely have to read it again. That piece of code might remain part of a project you’re working on. Every time you go back to that file, you’ll have to remember what that code does and why you wrote it, so readability matters.&lt;/p&gt;
&lt;p&gt;It can be difficult to remember what a piece of code does a few days, or weeks, after you wrote it.&lt;/p&gt;
&lt;p&gt;If you follow PEP 8, you can be sure that you’ve &lt;a href=&quot;#naming-conventions&quot;&gt;named&lt;/a&gt; your &lt;a href=&quot;https://realpython.com/python-variables/&quot;&gt;variables&lt;/a&gt; well. You’ll know that you’ve added &lt;a href=&quot;#whitespace-in-expressions-and-statements&quot;&gt;enough whitespace&lt;/a&gt; so it’s easier to follow logical steps in your code. You’ll also have &lt;a href=&quot;#comments&quot;&gt;commented&lt;/a&gt; your code well. All of this will mean your code is more readable and easier to come back to. If you’re a beginner, following the rules of PEP 8 can make learning Python a much more pleasant task.&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; Following PEP 8 is particularly important if you’re looking for a development job. Writing clear, readable code shows professionalism. It’ll tell an employer that you understand how to structure your code well.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;If you have more experience writing Python code, then you may need to collaborate with others. Writing readable code here is crucial. Other people, who may have never met you or seen your coding style before, will have to read and understand your code. Having guidelines that you follow and recognize will make it  easier for others to read your code.&lt;/p&gt;
&lt;h2 id=&quot;naming-conventions&quot;&gt;Naming Conventions&lt;a class=&quot;headerlink&quot; href=&quot;#naming-conventions&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;“Explicit is better than implicit.”&lt;/p&gt;
&lt;p&gt;— The Zen of Python&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;When you write Python code, you have to name a lot of things: variables, &lt;a href=&quot;https://realpython.com/defining-your-own-python-function/&quot;&gt;functions&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-classes/&quot;&gt;classes&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/pypi-publish-python-package/&quot;&gt;packages&lt;/a&gt;, and so on. Choosing sensible names will save you time and energy later. You’ll be able to figure out, from the name, what a certain variable, function, or class represents. You’ll also avoid using potentially confusing names that might result in errors that are difficult to debug.&lt;/p&gt;
&lt;p&gt;One suggestion is to never use &lt;code&gt;l&lt;/code&gt;, &lt;code&gt;O&lt;/code&gt;, or &lt;code&gt;I&lt;/code&gt; single letter names as these can be mistaken for &lt;code&gt;1&lt;/code&gt; and &lt;code&gt;0&lt;/code&gt;, depending on what &lt;a href=&quot;https://realpython.com/coding-font/&quot;&gt;typeface&lt;/a&gt; a programmer uses.&lt;/p&gt;
&lt;p&gt;For example, consider the code below, where you assign the value &lt;code&gt;2&lt;/code&gt; to the single letter &lt;code&gt;O&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;python&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;O&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;c1&quot;&gt;# ❌ Not recommended&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Doing this may look like you’re trying to reassign &lt;code&gt;2&lt;/code&gt; to zero. While making such a reassignment isn’t possible in Python and will cause a &lt;a href=&quot;https://realpython.com/python-exceptions/&quot;&gt;syntax error&lt;/a&gt;, using an ambigious variable name such as &lt;code&gt;O&lt;/code&gt; can make your code more confusing and harder to read and reason about.&lt;/p&gt;
&lt;h3 id=&quot;naming-styles&quot;&gt;Naming Styles&lt;a class=&quot;headerlink&quot; href=&quot;#naming-styles&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The table below outlines some of the common naming styles in Python code and when you should use them: &lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-pep8/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-pep8/ »&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 Basics Exercises: Lists and Tuples</title>
      <id>https://realpython.com/courses/python-basics-exercises-lists-tuples/</id>
      <link href="https://realpython.com/courses/python-basics-exercises-lists-tuples/"/>
      <updated>2024-02-06T14:00:00+00:00</updated>
      <summary>In this Python Basics Exercises video course, you&#x27;ll practice defining and manipulating Python lists and tuples in your code. By reinforcing your skills, you&#x27;ll gain confidence in using lists and tuples in your programming projects.</summary>
      <content type="html">
        &lt;p&gt;In &lt;a href=&quot;https://realpython.com/courses/python-basics-lists-tuples/&quot;&gt;Python Basics: Lists and Tuples&lt;/a&gt;, you learned that &lt;strong&gt;Python lists&lt;/strong&gt; resemble real-life lists in many ways. They serve as containers for organizing and storing collections of objects, allowing for the inclusion of different data types. You also learned about &lt;strong&gt;tuples&lt;/strong&gt;, which are also collections of objects. However, while lists are &lt;strong&gt;mutable&lt;/strong&gt;, tuples are &lt;strong&gt;immutable&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;In this Python Basics Exercises course, you&amp;rsquo;ll test and reinforce your knowledge of Python lists and tuples. Along the way, you&amp;rsquo;ll also get experience with some good programming practices that will help you solve future challenges.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this video course, you&amp;rsquo;ll practice:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Defining and manipulating lists and tuples in Python&lt;/li&gt;
&lt;li&gt;Leveraging the unique qualities of lists and tuples&lt;/li&gt;
&lt;li&gt;Determining when you should use lists vs tuples&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;By the end of this course, you&amp;rsquo;ll have an even stronger grasp of Python lists and tuples. You&amp;rsquo;ll be equipped with the knowledge to effectively incorporate them into your own programming projects.&lt;/p&gt;
&lt;p&gt;This video course is part of the Python Basics series, which accompanies &lt;a href=&quot;https://realpython.com/products/python-basics-book/&quot;&gt;&lt;em&gt;Python Basics: A Practical Introduction to Python 3&lt;/em&gt;&lt;/a&gt;. You can also check out the other &lt;a href=&quot;https://realpython.com/learning-paths/python-basics/&quot;&gt;Python Basics courses&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;Note that you&amp;rsquo;ll be using &lt;a href=&quot;https://realpython.com/python-idle/&quot;&gt;IDLE&lt;/a&gt; to &lt;a href=&quot;https://realpython.com/interacting-with-python/&quot;&gt;interact with Python&lt;/a&gt; throughout this course.&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 News: What&#x27;s New From January 2024</title>
      <id>https://realpython.com/python-news-january-2024/</id>
      <link href="https://realpython.com/python-news-january-2024/"/>
      <updated>2024-02-05T14:00:00+00:00</updated>
      <summary>In January 2024, Python 3.13.0a3 was released. A new JIT compiler was added to Python 3.13. The Python Software Foundation announced new developers in residence, and the Python ecosystem released new versions of projects, such as Django and pandas.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;In January 2024, Python &lt;strong&gt;3.13.0a3&lt;/strong&gt; was released! With several exciting features, improvements, and optimizations, this release is the third of six planned alpha releases. During the alpha phase, features may be added up until the start of the beta phase on May 7. This is a &lt;a href=&quot;https://realpython.com/python-pre-release/&quot;&gt;pre-release&lt;/a&gt;, and you shouldn’t use it for production environments. However, it’s a great way to try out some new and exciting language features.&lt;/p&gt;
&lt;p&gt;The steering council had its elections last December, and the Python Software Foundation made a few cool announcements, including the announcement of a new developer in residence.&lt;/p&gt;
&lt;p&gt;There is also exciting news regarding Python conferences, such as PyCon US 2024 and DjangoCon Europe 2024.&lt;/p&gt;
&lt;p&gt;Let’s dive into the most exciting &lt;strong&gt;Python news&lt;/strong&gt; from January 2024!&lt;/p&gt;
&lt;h2 id=&quot;python-3130-alpha-3-arrives&quot;&gt;Python 3.13.0 Alpha 3 Arrives&lt;a class=&quot;headerlink&quot; href=&quot;#python-3130-alpha-3-arrives&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;This January, Python &lt;a href=&quot;https://pythoninsider.blogspot.com/2024/01/python-3130-alpha-3-is-now-available.html&quot;&gt;released&lt;/a&gt; its third &lt;strong&gt;alpha preview release&lt;/strong&gt;, 3.13.0a3. This version is the third of six planned alpha releases. During the alpha phase, Python will receive new features up until the start of the &lt;strong&gt;beta phase&lt;/strong&gt; on May 7. Alpha releases make it easier to test the current state of new features and bug fixes and to test the release process.&lt;/p&gt;
&lt;p&gt;Many new features for Python 3.13 are still being planned. The primary efforts surround two core areas:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Removing the global interpreter lock, or GIL (&lt;a href=&quot;https://peps.python.org/pep-0703/&quot;&gt;PEP 703&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Improving Python performance&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So far, some of the most notable changes include the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Colorized &lt;a href=&quot;https://docs.python.org/dev/whatsnew/3.13.html#improved-error-messages&quot;&gt;exception tracebacks&lt;/a&gt; by default in the &lt;a href=&quot;https://realpython.com/python-repl/&quot;&gt;REPL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Stripped &lt;a href=&quot;https://docs.python.org/dev/whatsnew/3.13.html#other-language-changes&quot;&gt;leading indentation&lt;/a&gt; in &lt;a href=&quot;https://realpython.com/documenting-python-code/&quot;&gt;docstrings&lt;/a&gt;, which reduces memory use and the size of &lt;code&gt;.pyc&lt;/code&gt; files&lt;/li&gt;
&lt;li&gt;Scheduled removals of deprecated modules: &lt;code&gt;aifc&lt;/code&gt;, &lt;code&gt;audioop&lt;/code&gt;, &lt;code&gt;chunk&lt;/code&gt;, &lt;code&gt;cgi&lt;/code&gt;, &lt;code&gt;cgitb&lt;/code&gt;, &lt;code&gt;crypt&lt;/code&gt;, &lt;code&gt;imghdr&lt;/code&gt;, &lt;code&gt;mailcap&lt;/code&gt;, &lt;code&gt;msilib&lt;/code&gt;, &lt;code&gt;nis&lt;/code&gt;, &lt;code&gt;nntplib&lt;/code&gt;, &lt;code&gt;ossaudiodev&lt;/code&gt;, &lt;code&gt;pipes&lt;/code&gt;, &lt;code&gt;sndhdr&lt;/code&gt;, &lt;code&gt;spwd&lt;/code&gt;, &lt;code&gt;sunau&lt;/code&gt;, &lt;code&gt;telnetlib&lt;/code&gt;, &lt;code&gt;uu&lt;/code&gt;, &lt;code&gt;xdrlib&lt;/code&gt;, and &lt;code&gt;lib2to3&lt;/code&gt; (&lt;a href=&quot;https://peps.python.org/pep-0594/&quot;&gt;PEP 594&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.python.org/dev/whatsnew/3.13.html#removed&quot;&gt;Many other removals&lt;/a&gt; of deprecated classes, functions, and methods in various standard-library modules&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As usual, this version also brings several deprecations that you may need to consider. For a detailed list of changes, additions, and removals, you can check the &lt;a href=&quot;https://docs.python.org/3.12/whatsnew/changelog.html#python-3-12-0-release-candidate-1&quot;&gt;changelog&lt;/a&gt;. The next pre-release of Python 3.13 will be 3.13.0a4, which is currently scheduled for February 13.&lt;/p&gt;
&lt;h2 id=&quot;jit-just-in-time-compiler-available-on-python-313&quot;&gt;JIT (Just-in-Time) Compiler Available on Python 3.13&lt;a class=&quot;headerlink&quot; href=&quot;#jit-just-in-time-compiler-available-on-python-313&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In late December 2023, CPython core developer &lt;a href=&quot;https://github.com/brandtbucher&quot;&gt;Brandt Bucher&lt;/a&gt; pushed a &lt;a href=&quot;https://github.com/python/cpython/pull/113465&quot;&gt;pull request&lt;/a&gt; to the Python 3.13 branch adding a JIT (just-in-time) compiler. This pull request responds to issue &lt;a href=&quot;https://github.com/python/cpython/issues/113464&quot;&gt;#113464&lt;/a&gt; JIT Compilation, which is intended to add &lt;a href=&quot;https://en.wikipedia.org/wiki/Just-in-time_compilation&quot;&gt;just-in-time compilation&lt;/a&gt; to CPython 3.13.0.&lt;/p&gt;
&lt;p&gt;JIT compilation consists of compiling the code during the execution of a program rather than before execution. It’s an on-demand compilation.&lt;/p&gt;
&lt;p&gt;Real Python contributor &lt;a href=&quot;https://realpython.com/team/ashaw/&quot;&gt;Anthony Shaw&lt;/a&gt; has written a great post about this new &lt;a href=&quot;https://tonybaloney.github.io/posts/python-gets-a-jit.html&quot;&gt;JIT compiler in Python 3.13&lt;/a&gt;. In his article, he talks about JIT compilers and different types of them.&lt;/p&gt;
&lt;p&gt;The most exciting result of having this JIT compiler in Python 3.13 is that initial benchmarks show that Python’s performance will improve by &lt;a href=&quot;https://github.com/python/cpython/pull/113465#issuecomment-1876225775&quot;&gt;2 to 9 percent&lt;/a&gt;! This may seem like a small improvement, but as Anthony Shaw says:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Think of this JIT as being the cornerstone of a series of much larger optimizations. None of which are possible without it. (&lt;a href=&quot;https://tonybaloney.github.io/posts/python-gets-a-jit.html&quot;&gt;Source&lt;/a&gt;)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-news-january-2024/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-news-january-2024/ »&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 #190: Great Starting Points for Contributing to Open Source</title>
      <id>https://realpython.com/podcasts/rpp/190/</id>
      <link href="https://realpython.com/podcasts/rpp/190/"/>
      <updated>2024-02-02T12:00:00+00:00</updated>
      <summary>What&#x27;s it like to sit down for your first developer sprint at a conference? How do you find an appropriate issue to work on as a new open-source contributor? This week on the show, author and software engineer Stefanie Molin is here to discuss starting to contribute to open-source projects.</summary>
      <content type="html">
        &lt;p&gt;What&#x27;s it like to sit down for your first developer sprint at a conference? How do you find an appropriate issue to work on as a new open-source contributor? This week on the show, author and software engineer Stefanie Molin is here to discuss starting to contribute to open-source 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&#x27;s Format Mini-Language for Tidy Strings</title>
      <id>https://realpython.com/python-format-mini-language/</id>
      <link href="https://realpython.com/python-format-mini-language/"/>
      <updated>2024-01-31T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn about Python&#x27;s format mini-language. You&#x27;ll learn how to use the mini-language to create working format specifiers and build nicely formatted strings and messages in your code.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;When you’re doing &lt;a href=&quot;https://realpython.com/python-f-strings/#interpolating-and-formatting-strings-before-python-36&quot;&gt;string interpolation&lt;/a&gt; in your Python code, you often need to format the interpolated values to meet some formatting requirements. To do this, Python provides what is known as the &lt;strong&gt;format mini-language&lt;/strong&gt;, which defines the syntax of a &lt;strong&gt;format specifier&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Perhaps you’re comfortable working with strings, but you want to take even more control of them. With proficiency in the format mini-language, you’ll be able to use format specifiers to do things like formatting numbers as currency values, using scientific notation, expressing a value as a percentage, and so much more.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Learn the &lt;strong&gt;format mini-language syntax&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Align&lt;/strong&gt; and &lt;strong&gt;fill&lt;/strong&gt; textual output in your code&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Convert&lt;/strong&gt; between data &lt;strong&gt;types&lt;/strong&gt; in your outputs&lt;/li&gt;
&lt;li&gt;Provide &lt;strong&gt;format fields&lt;/strong&gt; dynamically&lt;/li&gt;
&lt;li&gt;Format &lt;strong&gt;numeric values&lt;/strong&gt; in different ways&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To get the most out of this tutorial, you should be familiar with Python’s string interpolation tools, such as the &lt;a href=&quot;https://realpython.com/python-formatted-output/#the-python-string-format-method&quot;&gt;&lt;code&gt;str.format()&lt;/code&gt;&lt;/a&gt; method and &lt;a href=&quot;https://realpython.com/python-f-strings/&quot;&gt;f-strings&lt;/a&gt;.&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 Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-format-mini-language-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-format-mini-language-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to download the free sample code&lt;/a&gt; that shows you how to use Python’s format mini-language for strings.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;using-string-interpolation-and-replacement-fields&quot;&gt;Using String Interpolation and Replacement Fields&lt;a class=&quot;headerlink&quot; href=&quot;#using-string-interpolation-and-replacement-fields&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;When you’re working with strings, it’s common that you need to embed or insert values and objects into your strings so that you can build new strings dynamically. This task is commonly known as &lt;strong&gt;string interpolation&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;In Python, you’ll find three popular tools that allow you to perform string interpolation:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The &lt;a href=&quot;https://realpython.com/python-modulo-string-formatting/&quot;&gt;modulo operator (&lt;code&gt;%&lt;/code&gt;)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;The &lt;a href=&quot;https://realpython.com/python-f-strings/#the-strformat-method&quot;&gt;&lt;code&gt;str.format()&lt;/code&gt; method&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/python-f-strings/#formatting-strings-with-pythons-f-string&quot;&gt;F-string literals&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The modulo operator is sort of an old-fashioned tool. It was the first string interpolation tool in Python. Unfortunately, it doesn’t provide many string formatting features. So, in this tutorial, you’ll focus on the &lt;code&gt;str.format()&lt;/code&gt; method and f-strings.&lt;/p&gt;
&lt;p&gt;To dynamically interpolate a value into a string, you need something called &lt;strong&gt;replacement fields&lt;/strong&gt;. In both &lt;code&gt;str.format()&lt;/code&gt; and f-strings, curly braces (&lt;code&gt;{}&lt;/code&gt;) delimit replacement fields. Inside these braces, you can put a variable, expression, or any object. When you run the code, Python replaces the field with the actual value.&lt;/p&gt;
&lt;p&gt;Anything not contained in braces is considered literal text, and Python copies it unchanged to the output.&lt;/p&gt;
&lt;p&gt;In the following sections, you’ll learn how replacement fields work in &lt;code&gt;str.format()&lt;/code&gt; and f-strings.&lt;/p&gt;
&lt;h3 id=&quot;the-strformat-method&quot;&gt;The &lt;code&gt;str.format()&lt;/code&gt; Method&lt;a class=&quot;headerlink&quot; href=&quot;#the-strformat-method&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;You can use &lt;code&gt;str.format()&lt;/code&gt; to interpolate values into your strings. This method operates on a string object where you insert replacement fields as needed. Then Python interpolates the arguments to &lt;code&gt;.format()&lt;/code&gt; into the string to build the final string dynamically:&lt;/p&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&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;s2&quot;&gt;&quot;Hello, &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;!&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;format&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Pythonista&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&#x27;Hello, Pythonista!&#x27;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;In this example, you have a string containing a replacement field. Then, you call &lt;code&gt;.format()&lt;/code&gt; with a single argument. When you run this code, the method inserts its argument into the replacement field and builds a final string.&lt;/p&gt;
&lt;p&gt;You can use &lt;code&gt;.format()&lt;/code&gt; in several ways. In the example above, the replacement field is empty. However, you can use zero-based indices to define a specific insertion order. You can also use named fields:&lt;/p&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&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;s2&quot;&gt;&quot;Hello, &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{0}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;! Good &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{1}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;!&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;format&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Pythonista&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;morning&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&#x27;Hello, Pythonista! Good morning!&#x27;&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Hello, &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{name}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;! Good &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{moment}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;!&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;format&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;name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Pythonista&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;moment&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;morning&quot;&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&#x27;Hello, Pythonista! Good morning!&#x27;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;In the first example, you use integer indices to define the order in which you want to insert each argument into the replacement fields. In the second example, you use explicit argument names to insert the values into the final string.&lt;/p&gt;
&lt;p&gt;The Python documentation uses the following &lt;a href=&quot;https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form&quot;&gt;Backus–Naur form (BNF) notation&lt;/a&gt; to define the syntax of a replacement field for the &lt;code&gt;.format()&lt;/code&gt; method:&lt;/p&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;abnf&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--grey&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;BNF Grammar&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;replacement_&lt;span class=&quot;nc&quot;&gt;field&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;::&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;l&quot;&gt;&quot;{&quot;&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;                            &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;field_&lt;span class=&quot;nc&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;                            &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;l&quot;&gt;&quot;!&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;conversion&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;                            &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;l&quot;&gt;&quot;:&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;format_&lt;span class=&quot;nc&quot;&gt;spec&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;                       &lt;/span&gt;&lt;span class=&quot;l&quot;&gt;&quot;}&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;From this BNF rule, you can conclude that the field name is optional. After that, you can use an exclamation mark (&lt;code&gt;!&lt;/code&gt;) to provide a quick &lt;code&gt;conversion&lt;/code&gt; field. This field can take one of the following forms:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;!s&lt;/code&gt; calls &lt;a href=&quot;https://docs.python.org/3/library/functions.html?highlight=built#func-str&quot;&gt;&lt;code&gt;str()&lt;/code&gt;&lt;/a&gt; on the argument.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;!r&lt;/code&gt; calls &lt;a href=&quot;https://docs.python.org/3/library/functions.html?highlight=built#repr&quot;&gt;&lt;code&gt;repr()&lt;/code&gt;&lt;/a&gt; on the argument.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;!a&lt;/code&gt; calls &lt;a href=&quot;https://docs.python.org/3/library/functions.html?highlight=built#ascii&quot;&gt;&lt;code&gt;ascii()&lt;/code&gt;&lt;/a&gt; on the argument.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-format-mini-language/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-format-mini-language/ »&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>Building Enumerations With Python&#x27;s enum</title>
      <id>https://realpython.com/courses/python-enum/</id>
      <link href="https://realpython.com/courses/python-enum/"/>
      <updated>2024-01-30T14:00:00+00:00</updated>
      <summary>In this video course, you&#x27;ll discover the art of creating and using enumerations of logically connected constants in Python. To accomplish this, you&#x27;ll explore the Enum class and other associated tools and types from the enum module from the Python standard library.</summary>
      <content type="html">
        &lt;p&gt;Some programming languages, such as Java and C++, have built-in support for a data type called &lt;strong&gt;enumerations&lt;/strong&gt;, commonly referred to as &lt;strong&gt;enums&lt;/strong&gt;. Enums enable you to create sets of logically related constants that you can access through the enumeration itself. Unlike these languages, Python doesn&amp;rsquo;t have a dedicated syntax for enums. However, the Python &lt;a href=&quot;https://docs.python.org/3/library/index.html&quot;&gt;standard library&lt;/a&gt; provides an &lt;code&gt;enum&lt;/code&gt; module that offers support for enumerations through the &lt;code&gt;Enum&lt;/code&gt; class.&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re familiar with enums from other languages and wish to use them in Python, or if you simply want to learn how to work with enumerations, then this video course is designed for you.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this video course, you&amp;rsquo;ll discover how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create &lt;strong&gt;enumerations&lt;/strong&gt; of constants using Python&amp;rsquo;s &lt;strong&gt;&lt;code&gt;Enum&lt;/code&gt;&lt;/strong&gt; class&lt;/li&gt;
&lt;li&gt;Interact with enumerations and their &lt;strong&gt;members&lt;/strong&gt; in Python&lt;/li&gt;
&lt;li&gt;Customize enumeration classes by adding &lt;strong&gt;new functionalities&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Apply &lt;strong&gt;practical examples&lt;/strong&gt; to gain a deeper understanding of the benefits of using enumerations&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Additionally, you&amp;rsquo;ll explore other specific enumeration types available in the &lt;code&gt;enum&lt;/code&gt; module, such as &lt;code&gt;IntEnum&lt;/code&gt;, &lt;code&gt;IntFlag&lt;/code&gt;, and &lt;code&gt;Flag&lt;/code&gt;. These specialized enums will expand your repertoire.&lt;/p&gt;
&lt;p&gt;To get the most out of this video course, you should be familiar with &lt;a href=&quot;https://realpython.com/python3-object-oriented-programming/&quot;&gt;object-oriented programming&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/inheritance-composition-python/&quot;&gt;inheritance&lt;/a&gt; in Python.&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 Exceptions: An Introduction</title>
      <id>https://realpython.com/python-exceptions/</id>
      <link href="https://realpython.com/python-exceptions/"/>
      <updated>2024-01-29T14:00:00+00:00</updated>
      <summary>In this beginner tutorial, you&#x27;ll learn what exceptions are good for in Python. You&#x27;ll see how to raise exceptions and how to handle them with try ... except blocks.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;A Python program terminates as soon as it encounters an error. In Python, an error can be a syntax error or an exception. In this tutorial, you’ll see what an exception is and how it differs from a syntax error. After that, you’ll learn about raising exceptions and making assertions. Then, you’ll get to know all the exception-related keywords that you can use in a &lt;code&gt;try&lt;/code&gt; … &lt;code&gt;except&lt;/code&gt; block to fine-tune how you can work with Python exceptions.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll learn how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Raise an exception&lt;/strong&gt; in Python with &lt;code&gt;raise&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Debug and test&lt;/strong&gt; your code with &lt;code&gt;assert&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Handle exceptions&lt;/strong&gt; with &lt;code&gt;try&lt;/code&gt; and &lt;code&gt;except&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Fine-tune your exception handling&lt;/strong&gt; with &lt;code&gt;else&lt;/code&gt; and &lt;code&gt;finally&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You’ll get to know these keywords by walking through a practical example of handling a platform-related exception. Finally, you’ll also learn how to create your own custom Python exceptions.&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 Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-exceptions-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-exceptions-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to download the free sample code&lt;/a&gt; that shows you how exceptions work in Python.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
  &lt;p&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt; Test your knowledge with our interactive “Python Exceptions: An Introduction” quiz. Upon completion you will receive a score so you can track your learning progress over time:&lt;/p&gt;
  &lt;p class=&quot;text-center my-2&quot;&gt;&lt;a class=&quot;btn btn-primary&quot; href=&quot;/quizzes/python-exceptions/&quot; target=&quot;_blank&quot;&gt;Take the Quiz »&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;understanding-exceptions-and-syntax-errors&quot;&gt;Understanding Exceptions and Syntax Errors&lt;a class=&quot;headerlink&quot; href=&quot;#understanding-exceptions-and-syntax-errors&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://realpython.com/invalid-syntax-python/&quot;&gt;Syntax errors&lt;/a&gt; occur when the parser detects an incorrect statement. Observe the following example:&lt;/p&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pytb&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python Traceback&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;x&quot;&gt;&amp;gt;&amp;gt;&amp;gt; print(0 / 0))&lt;/span&gt;
  File &lt;span class=&quot;nb&quot;&gt;&quot;&amp;lt;stdin&amp;gt;&quot;&lt;/span&gt;, line &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&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;p&quot;&gt;))&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;                &lt;/span&gt;&lt;span class=&quot;pm&quot;&gt;^&lt;/span&gt;
&lt;span class=&quot;gr&quot;&gt;SyntaxError&lt;/span&gt;: &lt;span class=&quot;n&quot;&gt;unmatched &#x27;)&#x27;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The arrow indicates where the parser ran into the &lt;strong&gt;syntax error&lt;/strong&gt;. Additionally, the error message gives you a hint about what went wrong. In this example, there was one bracket too many. Remove it and run your code again:&lt;/p&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&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;print&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;o&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;gt&quot;&gt;Traceback (most recent call last):&lt;/span&gt;
  File &lt;span class=&quot;nb&quot;&gt;&quot;&amp;lt;stdin&amp;gt;&quot;&lt;/span&gt;, line &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;, in &lt;span class=&quot;n&quot;&gt;&amp;lt;module&amp;gt;&lt;/span&gt;
&lt;span class=&quot;gr&quot;&gt;ZeroDivisionError&lt;/span&gt;: &lt;span class=&quot;n&quot;&gt;division by zero&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This time, you ran into an &lt;strong&gt;exception error&lt;/strong&gt;. This type of error occurs whenever syntactically correct Python code results in an error. The last line of the message indicates what type of exception error you ran into.&lt;/p&gt;
&lt;p&gt;Instead of just writing &lt;em&gt;exception error&lt;/em&gt;, Python details what &lt;em&gt;type&lt;/em&gt; of exception error it encountered. In this case, it was a &lt;code&gt;ZeroDivisionError&lt;/code&gt;. Python comes with &lt;a href=&quot;https://docs.python.org/3/library/exceptions.html&quot;&gt;various built-in exceptions&lt;/a&gt; as well as the possibility to create user-defined exceptions.&lt;/p&gt;
&lt;h2 id=&quot;raising-an-exception-in-python&quot;&gt;Raising an Exception in Python&lt;a class=&quot;headerlink&quot; href=&quot;#raising-an-exception-in-python&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;There are scenarios where you might want to stop your program by raising an exception if a condition occurs. You can do this with the &lt;a href=&quot;https://realpython.com/python-raise-exception/&quot;&gt;&lt;code&gt;raise&lt;/code&gt;&lt;/a&gt; keyword:&lt;/p&gt;
&lt;figure class=&quot;js-lightbox&quot;&gt;&lt;a href=&quot;https://files.realpython.com/media/raise.3931e8819e08.png&quot; target=&quot;_blank&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid mx-auto d-block &quot; src=&quot;https://files.realpython.com/media/raise.3931e8819e08.png&quot; width=&quot;1394&quot; height=&quot;311&quot; srcset=&quot;https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/raise.3931e8819e08.png&amp;amp;w=348&amp;amp;sig=fe4872f24f9121ecf0f4dbdba805c754f0fd42cf 348w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/raise.3931e8819e08.png&amp;amp;w=464&amp;amp;sig=dc5fd94d9614729105d5285574d5b4755ee1454a 464w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/raise.3931e8819e08.png&amp;amp;w=697&amp;amp;sig=8f2b5e3f414c44ff5f7464e4793598843ba71ad1 697w, https://files.realpython.com/media/raise.3931e8819e08.png 1394w&quot; sizes=&quot;(min-width: 1200px) 690px, (min-width: 780px) calc(-5vw + 669px), (min-width: 580px) 510px, calc(100vw - 30px)&quot; alt=&quot;Illustration of  raise statement usage&quot; data-asset=&quot;394&quot;&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;You can even complement the statement with a custom message. Assume that you’re writing a tiny toy program that expects only numbers up to &lt;code&gt;5&lt;/code&gt;. You can raise an error when an unwanted condition occurs:&lt;/p&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;python&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    &lt;span class=&quot;mr-2&quot; aria-label=&quot;Filename&quot;&gt;&lt;code style=&quot;color: inherit;&quot;&gt;low.py&lt;/code&gt;&lt;/span&gt;
    &lt;div class=&quot;noselect&quot;&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;number&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;number&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;raise&lt;/span&gt; &lt;span class=&quot;ne&quot;&gt;Exception&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sa&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;The number should not exceed 5. (&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;number&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;=}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;)&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;number&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;In this example, you raised an &lt;code&gt;Exception&lt;/code&gt; object and passed it an informative custom message. You built the message using an &lt;a href=&quot;https://realpython.com/python-f-strings/&quot;&gt;f-string&lt;/a&gt; and a &lt;a href=&quot;https://realpython.com/python-f-strings/#self-documenting-expressions-for-debugging&quot;&gt;self-documenting expression&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;When you run &lt;code&gt;low.py&lt;/code&gt;, you’ll get the following output:&lt;/p&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pytb&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python Traceback&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gt&quot;&gt;Traceback (most recent call last):&lt;/span&gt;
  File &lt;span class=&quot;nb&quot;&gt;&quot;./low.py&quot;&lt;/span&gt;, line &lt;span class=&quot;m&quot;&gt;3&lt;/span&gt;, in &lt;span class=&quot;n&quot;&gt;&amp;lt;module&amp;gt;&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;raise&lt;/span&gt; &lt;span class=&quot;ne&quot;&gt;Exception&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sa&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;The number should not exceed 5. (&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;number&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;=}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;)&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;gr&quot;&gt;Exception&lt;/span&gt;: &lt;span class=&quot;n&quot;&gt;The number should not exceed 5. (number=10)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The program comes to a halt and displays the exception to your &lt;a href=&quot;https://realpython.com/terminal-commands/&quot;&gt;terminal&lt;/a&gt; or &lt;a href=&quot;https://realpython.com/python-repl/&quot;&gt;REPL&lt;/a&gt;, offering you helpful clues about what went wrong. Note that the final call to &lt;a href=&quot;https://realpython.com/python-print/&quot;&gt;&lt;code&gt;print()&lt;/code&gt;&lt;/a&gt; never executed, because Python raised the exception before it got to that line of code.&lt;/p&gt;
&lt;p&gt;With the &lt;code&gt;raise&lt;/code&gt; keyword, you can raise any exception object in Python and stop your program when an unwanted condition occurs.&lt;/p&gt;
&lt;h2 id=&quot;debugging-during-development-with-assert&quot;&gt;Debugging During Development With &lt;code&gt;assert&lt;/code&gt;&lt;a class=&quot;headerlink&quot; href=&quot;#debugging-during-development-with-assert&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Before moving on to the most common way of working with exceptions in Python using &lt;a href=&quot;https://realpython.com/python-exceptions/#handling-exceptions-with-the-try-and-except-block&quot;&gt;the &lt;code&gt;try&lt;/code&gt; … &lt;code&gt;except&lt;/code&gt; block&lt;/a&gt;, you’ll take a quick look at an exception that’s a bit different than the others.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-exceptions/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-exceptions/ »&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 #189: Building a Python Debugger &amp; Preparing for NumPy 2.0</title>
      <id>https://realpython.com/podcasts/rpp/189/</id>
      <link href="https://realpython.com/podcasts/rpp/189/"/>
      <updated>2024-01-26T12:34:00+00:00</updated>
      <summary>How does a debugger work? What can you learn about Python by building one from scratch? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;How does a debugger work? What can you learn about Python by building one from scratch? Christopher Trudeau is back on the show this week, bringing 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 Are Python Raw Strings?</title>
      <id>https://realpython.com/python-raw-strings/</id>
      <link href="https://realpython.com/python-raw-strings/"/>
      <updated>2024-01-24T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn the nuances of using raw string literals in your Python source code. Raw strings offer convenient syntax for including backslash characters in string literals without the complexity of escape sequences.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;If you’ve ever come across a standard &lt;a href=&quot;https://en.wikipedia.org/wiki/String_literal&quot;&gt;string literal&lt;/a&gt; prefixed with either the lowercase letter &lt;code&gt;r&lt;/code&gt; or the uppercase letter &lt;code&gt;R&lt;/code&gt;, then you’ve encountered a Python &lt;strong&gt;raw string&lt;/strong&gt;:&lt;/p&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&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;sa&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;This is a raw string&quot;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&#x27;This is a raw string&#x27;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Although a raw string looks and behaves mostly the same as a normal string literal, there’s an important difference in how Python interprets some of its characters, which you’ll explore in this tutorial.&lt;/p&gt;
&lt;p&gt;Notice that there’s nothing special about the resulting string object. Whether you declare your &lt;a href=&quot;https://en.wikipedia.org/wiki/Literal_(computer_programming)&quot;&gt;literal value&lt;/a&gt; using a prefix or not, you’ll always end up with a regular Python &lt;code&gt;str&lt;/code&gt; object.&lt;/p&gt;
&lt;p&gt;Other prefixes available at your fingertips, which you can use and sometimes even &lt;a href=&quot;https://docs.python.org/3/reference/lexical_analysis.html#grammar-token-python-grammar-stringprefix&quot;&gt;mix together&lt;/a&gt; in your Python string literals, include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;b&lt;/code&gt;: Bytes literal&lt;/li&gt;
&lt;li&gt;&lt;code&gt;f&lt;/code&gt;: Formatted string literal&lt;/li&gt;
&lt;li&gt;&lt;code&gt;u&lt;/code&gt;: Legacy Unicode string literal (&lt;a href=&quot;https://peps.python.org/pep-0414/&quot;&gt;PEP 414&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Out of those, you might be most familiar with &lt;a href=&quot;https://realpython.com/python-f-strings/&quot;&gt;f-strings&lt;/a&gt;, which let you evaluate expressions inside string literals. Raw strings aren’t as popular as f-strings, but they do have their own uses that can improve your code’s readability.&lt;/p&gt;
&lt;p&gt;Creating a &lt;a href=&quot;https://realpython.com/python-strings/&quot;&gt;string of characters&lt;/a&gt; is often one of the first skills that you learn when studying a new programming language. The Python Basics &lt;a href=&quot;https://realpython.com/products/python-basics-book/&quot;&gt;book&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/learning-paths/python-basics/&quot;&gt;learning path&lt;/a&gt; cover this topic right at the beginning. With Python, you can define string literals in your source code by delimiting the text with either single quotes (&lt;code&gt;&#x27;&lt;/code&gt;) or double quotes (&lt;code&gt;&quot;&lt;/code&gt;):&lt;/p&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&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;david&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#x27;She said &quot;I love you&quot; to me.&#x27;&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;alice&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Oh, that&#x27;s wonderful to hear!&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Having such a choice can help you avoid a syntax error when your text includes one of those delimiting characters (&lt;code&gt;&#x27;&lt;/code&gt; or &lt;code&gt;&quot;&lt;/code&gt;). For example, if you need to represent an apostrophe in a string, then you can enclose your text in double quotes. Alternatively, you can use multiline strings to mix both types of delimiters in the text.&lt;/p&gt;
&lt;p&gt;You may use triple quotes (&lt;code&gt;&#x27;&#x27;&#x27;&lt;/code&gt; or &lt;code&gt;&quot;&quot;&quot;&lt;/code&gt;) to declare a &lt;strong&gt;multiline string literal&lt;/strong&gt; that can accommodate a longer piece of text, such as an excerpt from the &lt;a href=&quot;https://realpython.com/zen-of-python/&quot;&gt;Zen of Python&lt;/a&gt;:&lt;/p&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&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;poem&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;Beautiful is better than ugly.&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;Explicit is better than implicit.&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;Simple is better than complex.&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;Complex is better than complicated.&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Multiline string literals can optionally act as &lt;a href=&quot;https://realpython.com/documenting-python-code/&quot;&gt;docstrings&lt;/a&gt;, a useful form of code documentation in Python. Docstrings can include bare-bones test cases known as &lt;a href=&quot;https://realpython.com/python-doctest/&quot;&gt;doctests&lt;/a&gt;, as well.&lt;/p&gt;
&lt;p&gt;Regardless of the delimiter type of your choice, you can always prepend a prefix to your string literal. Just make sure there’s no space between the prefix letters and the opening quote.&lt;/p&gt;
&lt;p&gt;When you use the letter &lt;code&gt;r&lt;/code&gt; as the prefix, you’ll turn the corresponding string literal into a raw string counterpart. &lt;strong&gt;So, what are Python raw strings exactly?&lt;/strong&gt;&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/escape-character-sequences-cheatsheet/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-escape-character-sequences-cheatsheet&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to download a cheatsheet&lt;/a&gt; that shows you the most useful Python escape character sequences.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
  &lt;p&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt; Test your knowledge with our interactive “Python Raw Strings” quiz. Upon completion you will receive a score so you can track your learning progress over time:&lt;/p&gt;
  &lt;p class=&quot;text-center my-2&quot;&gt;&lt;a class=&quot;btn btn-primary&quot; href=&quot;/quizzes/python-raw-strings/&quot; target=&quot;_blank&quot;&gt;Take the Quiz »&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;in-short-python-raw-strings-ignore-escape-character-sequences&quot;&gt;In Short: Python Raw Strings Ignore Escape Character Sequences&lt;a class=&quot;headerlink&quot; href=&quot;#in-short-python-raw-strings-ignore-escape-character-sequences&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In some cases, defining a string through the raw string literal will produce precisely the same result as using the standard string literal in Python:&lt;/p&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&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;sa&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;I love you&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;I love you&quot;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;True&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Here, both literals represent string objects that share a common value: the text &lt;em&gt;I love you&lt;/em&gt;. Even though the first literal comes with a prefix, it has no effect on the outcome, so both strings compare as equal.&lt;/p&gt;
&lt;p&gt;To observe the real difference between raw and standard string literals in Python, consider a different example depicting a date formatted as a string:&lt;/p&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&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;sa&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;10\25\1991&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;10&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\25\1&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;991&quot;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;False&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This time, the comparison turns out to be false even though the two string literals look visually similar. Unlike before, the resulting string objects no longer contain the same sequence of characters. The raw string’s prefix (&lt;code&gt;r&lt;/code&gt;) changes the meaning of special character sequences that begin with a &lt;a href=&quot;https://en.wikipedia.org/wiki/Backslash&quot;&gt;backslash (&lt;code&gt;\&lt;/code&gt;)&lt;/a&gt; inside the literal.&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; To understand how Python interprets the above string, head over to the &lt;a href=&quot;#what-are-the-common-escape-character-sequences&quot;&gt;final section&lt;/a&gt; of this tutorial, where you’ll cover the most common types of escape sequences in Python.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-raw-strings/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-raw-strings/ »&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 Basics: Lists and Tuples</title>
      <id>https://realpython.com/courses/python-basics-lists-tuples/</id>
      <link href="https://realpython.com/courses/python-basics-lists-tuples/"/>
      <updated>2024-01-23T14:00:00+00:00</updated>
      <summary>In this video course, you&#x27;ll learn about Python lists and tuples, including how to define and manipulate them in your code. By the end of the course, you&#x27;ll be ready to effectively use lists and tuples in your programming projects.</summary>
      <content type="html">
        &lt;p&gt;&lt;strong&gt;Python lists&lt;/strong&gt; are similar to real-life lists. You can use them to store and organize a collection of objects, which can be of any data type. Instead of just storing one item, a list can hold multiple items while allowing manipulation and retrieval of those items. Because lists are &lt;strong&gt;mutable&lt;/strong&gt;, you can think of them as being written in pencil. In other words, you can make changes.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Tuples&lt;/strong&gt;, on the other hand, are written in ink. They&amp;rsquo;re similar to lists in that they can hold multiple items, but unlike lists, tuples are &lt;strong&gt;immutable&lt;/strong&gt;, meaning you can&amp;rsquo;t modify them after you&amp;rsquo;ve created them.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this video course, you&amp;rsquo;ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What lists and tuples are and how they&amp;rsquo;re structured&lt;/li&gt;
&lt;li&gt;How lists and tuples differ from other data structures&lt;/li&gt;
&lt;li&gt;How to define and manipulate lists and tuples in your Python code&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;By the end of this course, you&amp;rsquo;ll have a solid understanding of Python lists and tuples, and you&amp;rsquo;ll be able to use them effectively in your own programming projects.&lt;/p&gt;
&lt;p&gt;This video course is part of the Python Basics series, which accompanies &lt;a href=&quot;https://realpython.com/products/python-basics-book/&quot;&gt;&lt;em&gt;Python Basics: A Practical Introduction to Python 3&lt;/em&gt;&lt;/a&gt;. You can also check out the other &lt;a href=&quot;https://realpython.com/learning-paths/python-basics/&quot;&gt;Python Basics courses&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;Note that you&amp;rsquo;ll be using &lt;a href=&quot;https://realpython.com/python-idle/&quot;&gt;IDLE&lt;/a&gt; to &lt;a href=&quot;https://realpython.com/interacting-with-python/&quot;&gt;interact with Python&lt;/a&gt; throughout this course.&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>When to Use a List Comprehension in Python</title>
      <id>https://realpython.com/list-comprehension-python/</id>
      <link href="https://realpython.com/list-comprehension-python/"/>
      <updated>2024-01-22T14:00:00+00:00</updated>
      <summary>Python list comprehensions help you to create lists while performing sophisticated filtering, mapping, and conditional logic on their members. In this tutorial, you&#x27;ll learn when to use a list comprehension in Python and how to create them effectively.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;One of Python’s most distinctive features is the &lt;strong&gt;list comprehension&lt;/strong&gt;, which you can use to create powerful functionality within a single line of code. However, many developers struggle to fully leverage the more advanced features of list comprehensions in Python. Some programmers even use them too much, which can lead to code that’s less efficient and harder to read.&lt;/p&gt;
&lt;p&gt;By the end of this tutorial, you’ll understand the full power of Python list comprehensions and know how to use their features comfortably. You’ll also gain an understanding of the trade-offs that come with using them so that you can determine when other approaches are preferable.&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;Rewrite loops and &lt;code&gt;map()&lt;/code&gt; calls as &lt;strong&gt;list comprehensions&lt;/strong&gt; in Python&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Choose&lt;/strong&gt; between comprehensions, loops, and &lt;code&gt;map()&lt;/code&gt; calls&lt;/li&gt;
&lt;li&gt;Supercharge your comprehensions with &lt;strong&gt;conditional logic&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Use comprehensions to &lt;strong&gt;replace &lt;code&gt;filter()&lt;/code&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Profile&lt;/strong&gt; your code to resolve performance questions&lt;/li&gt;
&lt;/ul&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 Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/list-comprehension-python-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-list-comprehension-python-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to download the free code&lt;/a&gt; that shows you how and when to use list comprehensions in Python.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;transforming-lists-in-python&quot;&gt;Transforming Lists in Python&lt;a class=&quot;headerlink&quot; href=&quot;#transforming-lists-in-python&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;There are a few different ways to create and add items to a &lt;a href=&quot;https://realpython.com/python-lists-tuples/&quot;&gt;lists&lt;/a&gt; in Python. In this section, you’ll explore &lt;code&gt;for&lt;/code&gt; loops and the &lt;code&gt;map()&lt;/code&gt; function to perform these tasks. Then, you’ll move on to learn about how to use list comprehensions and when list comprehensions can benefit your Python program.&lt;/p&gt;
&lt;h3 id=&quot;use-for-loops&quot;&gt;Use &lt;code&gt;for&lt;/code&gt; Loops&lt;a class=&quot;headerlink&quot; href=&quot;#use-for-loops&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The most common type of loop is the &lt;a href=&quot;https://realpython.com/python-for-loop/&quot;&gt;&lt;code&gt;for&lt;/code&gt; loop&lt;/a&gt;. You can use a &lt;code&gt;for&lt;/code&gt; loop to create a list of elements in three steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Instantiate an empty list.&lt;/li&gt;
&lt;li&gt;Loop over an iterable or &lt;a href=&quot;https://realpython.com/python-range/&quot;&gt;range&lt;/a&gt; of elements.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/python-append/&quot;&gt;Append&lt;/a&gt; each element to the end of the list.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you want to create a list containing the first ten perfect squares, then you can complete these steps in three lines of code:&lt;/p&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&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;squares&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;number&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;mi&quot;&gt;10&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;squares&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;number&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;number&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;squares&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Here, you instantiate an empty list, &lt;code&gt;squares&lt;/code&gt;. Then, you use a &lt;code&gt;for&lt;/code&gt; loop to iterate over &lt;code&gt;range(10)&lt;/code&gt;. Finally, you multiply each &lt;a href=&quot;https://realpython.com/python-numbers/&quot;&gt;number&lt;/a&gt; by itself and append the result to the end of the list.&lt;/p&gt;
&lt;h3 id=&quot;work-with-map-objects&quot;&gt;Work With &lt;code&gt;map&lt;/code&gt; Objects&lt;a class=&quot;headerlink&quot; href=&quot;#work-with-map-objects&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;For an alternative approach that’s based in &lt;a href=&quot;https://realpython.com/python-functional-programming/&quot;&gt;functional programming&lt;/a&gt;, you can use &lt;a href=&quot;https://realpython.com/python-map-function/&quot;&gt;&lt;code&gt;map()&lt;/code&gt;&lt;/a&gt;. You pass in a function and an iterable, and &lt;code&gt;map()&lt;/code&gt; will create an object. This object contains the result that you’d get from running each iterable element through the supplied function.&lt;/p&gt;
&lt;p&gt;As an example, consider a situation in which you need to calculate the price after tax for a list of transactions:&lt;/p&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&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;prices&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;mf&quot;&gt;1.09&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;23.56&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;57.84&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;4.56&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;6.78&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;TAX_RATE&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;.08&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;get_price_with_tax&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;price&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;price&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;1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;TAX_RATE&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;final_prices&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;map&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get_price_with_tax&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;prices&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;final_prices&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&amp;lt;map object at 0x7f34da341f90&amp;gt;&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;final_prices&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[1.1772000000000002, 25.4448, 62.467200000000005, 4.9248, 7.322400000000001]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Here, you have an iterable, &lt;code&gt;prices&lt;/code&gt;, and a function, &lt;code&gt;get_price_with_tax()&lt;/code&gt;. You pass both of these arguments to &lt;code&gt;map()&lt;/code&gt; and store the resulting &lt;code&gt;map&lt;/code&gt; object in &lt;code&gt;final_prices&lt;/code&gt;. Finally, you convert &lt;code&gt;final_prices&lt;/code&gt; into a list using &lt;code&gt;list()&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&quot;leverage-list-comprehensions&quot;&gt;Leverage List Comprehensions&lt;a class=&quot;headerlink&quot; href=&quot;#leverage-list-comprehensions&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;List comprehensions are a third way of making or transforming lists. With this elegant approach, you could rewrite the &lt;code&gt;for&lt;/code&gt; loop from the first example in just a single line of code:&lt;/p&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&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;squares&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;number&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;number&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;number&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;mi&quot;&gt;10&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;squares&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.827db10c169f.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Rather than creating an empty list and adding each element to the end, you simply define the list and its contents at the same time by following this format:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;new_list = [expression for member in iterable]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Every list comprehension in Python includes three elements:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/strong&gt; is the member itself, a call to a method, or any other valid expression that returns a value. In the example above, the expression &lt;code&gt;number * number&lt;/code&gt; is the square of the member value.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;member&lt;/code&gt;&lt;/strong&gt; is the object or value in the list or iterable. In the example above, the member value is &lt;code&gt;number&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;iterable&lt;/code&gt;&lt;/strong&gt; is a list, &lt;a href=&quot;https://realpython.com/python-sets/&quot;&gt;set&lt;/a&gt;, sequence, &lt;a href=&quot;https://realpython.com/introduction-to-python-generators/&quot;&gt;generator&lt;/a&gt;, or any other object that can return its elements one at a time. In the example above, the iterable is &lt;code&gt;range(10)&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/list-comprehension-python/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/list-comprehension-python/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #188: Measuring Bias, Toxicity, and Truthfulness in LLMs With Python</title>
      <id>https://realpython.com/podcasts/rpp/188/</id>
      <link href="https://realpython.com/podcasts/rpp/188/"/>
      <updated>2024-01-19T12:00:00+00:00</updated>
      <summary>How can you measure the quality of a large language model? What tools can measure bias, toxicity, and truthfulness levels in a model using Python? This week on the show, Jodie Burchell, developer advocate for data science at JetBrains, returns to discuss techniques and tools for evaluating LLMs With Python.</summary>
      <content type="html">
        &lt;p&gt;How can you measure the quality of a large language model? What tools can measure bias, toxicity, and truthfulness levels in a model using Python? This week on the show, Jodie Burchell, developer advocate for data science at JetBrains, returns to discuss techniques and tools for evaluating LLMs With Python.&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 Python for Data Analysis</title>
      <id>https://realpython.com/python-for-data-analysis/</id>
      <link href="https://realpython.com/python-for-data-analysis/"/>
      <updated>2024-01-17T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn the importance of having a structured data analysis workflow, and you&#x27;ll get the opportunity to practice using Python for data analysis while following a common workflow process.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;&lt;strong&gt;Data analysis&lt;/strong&gt; is a broad term that covers a wide range of techniques that enable you to reveal any insights and relationships that may exist within raw data. As you might expect, Python lends itself readily to data analysis. Once Python has analyzed your data, you can then use your findings to make good business decisions, improve procedures, and even make informed predictions based on what you’ve discovered.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Understand the need for a sound &lt;strong&gt;data analysis workflow&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Understand the &lt;strong&gt;different stages&lt;/strong&gt; of a data analysis workflow&lt;/li&gt;
&lt;li&gt;Learn how you can use &lt;strong&gt;Python&lt;/strong&gt; for data analysis&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Before you start, you should familiarize yourself with &lt;a href=&quot;https://realpython.com/jupyter-notebook-introduction/&quot;&gt;Jupyter Notebook&lt;/a&gt;, a popular tool for data analysis. Alternatively, &lt;a href=&quot;https://realpython.com/using-jupyterlab/&quot;&gt;JupyterLab&lt;/a&gt; will give you an enhanced notebook experience. You might also like to learn how a &lt;a href=&quot;https://realpython.com/pandas-dataframe/#introducing-the-pandas-dataframe&quot;&gt;pandas DataFrame&lt;/a&gt; stores its data. Knowing the difference between a &lt;a href=&quot;https://pandas.pydata.org/docs/user_guide/dsintro.html#dataframe&quot;&gt;DataFrame&lt;/a&gt; and a &lt;a href=&quot;https://pandas.pydata.org/docs/user_guide/dsintro.html#series&quot;&gt;pandas Series&lt;/a&gt; will also prove useful.&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 Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-for-data-analysis-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-for-data-analysis-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to download the free data files and sample code&lt;/a&gt; for your mission into data analysis with Python.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;In this tutorial, you’ll use a file named &lt;code&gt;james_bond_data.csv&lt;/code&gt;. This is a doctored version of the free &lt;a href=&quot;https://www.kaggle.com/datasets/dreb87/jamesbond/data&quot;&gt;James Bond Movie Dataset&lt;/a&gt;. The &lt;code&gt;james_bond_data.csv&lt;/code&gt; file contains a subset of the original data with some of the records altered to make them suitable for this tutorial. You’ll find it in the downloadable materials. Once you have your data file, you’re ready to begin your first mission into data analysis.&lt;/p&gt;
&lt;h2 id=&quot;understanding-the-need-for-a-data-analysis-workflow&quot;&gt;Understanding the Need for a Data Analysis Workflow&lt;a class=&quot;headerlink&quot; href=&quot;#understanding-the-need-for-a-data-analysis-workflow&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Data analysis is a very popular field and can involve performing many different tasks of varying complexity. Which specific analysis steps you perform will depend on which dataset you’re analyzing and what information you hope to glean. To overcome these scope and complexity issues, you need to take a strategic approach when performing your analysis. This is where a &lt;strong&gt;data analysis workflow&lt;/strong&gt; can help you.&lt;/p&gt;
&lt;p&gt;A data analysis workflow is a process that provides a set of steps for your analysis team to follow when analyzing data. The implementation of each of these steps will vary depending on the nature of your analysis, but following an agreed-upon workflow allows everyone involved to know what needs to happen and to see how the project is progressing.&lt;/p&gt;
&lt;p&gt;Using a workflow also helps futureproof your analysis methodology. By following the defined set of steps, your efforts become systematic, which minimizes the possibility that you’ll make mistakes or miss something. Furthermore, when you carefully document your work, you can reapply your procedures against future data as it becomes available. Data analysis workflows therefore also provide repeatability and scalability.&lt;/p&gt;
&lt;p&gt;There’s no single data workflow process that suits every analysis, nor is there universal terminology for the procedures used within it. To provide a structure for the rest of this tutorial, the diagram below illustrates the stages that you’ll commonly find in most workflows:&lt;/p&gt;
&lt;figure class=&quot;js-lightbox&quot;&gt;&lt;a href=&quot;https://files.realpython.com/media/ie-data-analysis-workflowv3.bfb835b95c5e.png&quot; target=&quot;_blank&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid mx-auto d-block &quot; src=&quot;https://files.realpython.com/media/ie-data-analysis-workflowv3.bfb835b95c5e.png&quot; width=&quot;1292&quot; height=&quot;569&quot; srcset=&quot;https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/ie-data-analysis-workflowv3.bfb835b95c5e.png&amp;amp;w=323&amp;amp;sig=724ecd4801da97582252a82ecbae17c83aab6c33 323w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/ie-data-analysis-workflowv3.bfb835b95c5e.png&amp;amp;w=430&amp;amp;sig=72a4545ee2f4c236e9d7a3b1ec3700ce2b6141c5 430w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/ie-data-analysis-workflowv3.bfb835b95c5e.png&amp;amp;w=646&amp;amp;sig=9d2c7db9de6d5a4d0c703ea90b63c2ecb840cd87 646w, https://files.realpython.com/media/ie-data-analysis-workflowv3.bfb835b95c5e.png 1292w&quot; sizes=&quot;(min-width: 1200px) 690px, (min-width: 780px) calc(-5vw + 669px), (min-width: 580px) 510px, calc(100vw - 30px)&quot; alt=&quot;diagram of a data analysis workflow with iterations&quot; data-asset=&quot;5525&quot;&gt;&lt;/a&gt;&lt;figcaption class=&quot;figure-caption text-center&quot;&gt;A Data Analysis Workflow&lt;/figcaption&gt;&lt;/figure&gt;

&lt;p&gt;The solid arrows show the standard data analysis workflow that you’ll work through to learn what happens at each stage. The dashed arrows indicate where you may need to carry out some of the individual steps several times depending upon the success of your analysis. Indeed, you may even have to repeat the entire process should your first analysis reveal something interesting that demands further attention.&lt;/p&gt;
&lt;p&gt;Now that you have an understanding of the need for a data analysis workflow, you’ll work through its steps and perform an analysis of movie data. The movies that you’ll analyze all relate to the British secret agent Bond … &lt;em&gt;James Bond.&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;setting-your-objectives&quot;&gt;Setting Your Objectives&lt;a class=&quot;headerlink&quot; href=&quot;#setting-your-objectives&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The very first workflow step in data analysis is to carefully but clearly define your objectives. It’s vitally important for you and your analysis team to be clear on what exactly you’re all trying to achieve. This step doesn’t involve any programming but is every bit as important because, without an understanding of where you want to go, you’re unlikely to ever get there.&lt;/p&gt;
&lt;p&gt;The objectives of your data analysis will vary depending on what you’re analyzing. Your team leader may want to know why a new product hasn’t sold, or perhaps your government wants information about a clinical test of a new medical drug. You may even be asked to make investment recommendations based on the past results of a particular financial instrument. Regardless, you must still be clear on your objectives. These define your scope.&lt;/p&gt;
&lt;p&gt;In this tutorial, you’ll gain experience in data analysis by having some fun with the James Bond movie dataset mentioned earlier. What are your objectives? &lt;em&gt;Now pay attention, 007&lt;/em&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Is there any relationship between the Rotten Tomatoes ratings and those from IMDb?&lt;/li&gt;
&lt;li&gt;Are there any insights to be gleaned from analyzing the lengths of the movies?&lt;/li&gt;
&lt;li&gt;Is there a relationship between the number of enemies James Bond has killed and the user ratings of the movie in which they were killed?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Now that you’ve been briefed on your mission, it’s time to get out into the field and see what intelligence you can uncover.&lt;/p&gt;
&lt;h2 id=&quot;acquiring-your-data&quot;&gt;Acquiring Your Data&lt;a class=&quot;headerlink&quot; href=&quot;#acquiring-your-data&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Once you’ve established your objectives, your next step is to think about what data you’ll need to achieve them. Hopefully, this data will be readily available, but you may have to work hard to get it. You may need to extract it from the data storage systems within an organization or &lt;a href=&quot;https://en.wikipedia.org/wiki/Survey_data_collection&quot;&gt;collect survey data&lt;/a&gt;. Regardless, you’ll somehow need to get the data.&lt;/p&gt;
&lt;p&gt;In this case, you’re in luck. When your bosses briefed you on your objectives, they also gave you the data in the &lt;code&gt;james_bond_data.csv&lt;/code&gt; file. You must now spend some time becoming familiar with what you have in front of you. During the briefing, you made some notes on the content of this file:&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;Heading&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Release&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The release date of the movie&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Movie&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The title of the movie&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Bond&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The actor playing the title role&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Bond_Car_MFG&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The manufacturer of James Bond’s car&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;US_Gross&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The movie’s gross US earnings&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;World_Gross&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The movie’s gross worldwide earnings&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Budget ($ 000s)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The movie’s budget, in thousands of US dollars&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Film_Length&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The running time of the movie&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Avg_User_IMDB&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The average user rating from IMDb&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Avg_User_Rtn_Tom&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The average user rating from Rotten Tomatoes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Martinis&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The number of martinis that Bond drank in the movie&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;As you can see, you have quite a variety of data. You won’t need all of it to meet your objectives, but you can think more about this later. For now, you’ll concentrate on getting the data out of the file and into Python for cleansing and analysis.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-for-data-analysis/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-for-data-analysis/ »&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>Create a Tic-Tac-Toe Python Game Engine With an AI Player</title>
      <id>https://realpython.com/courses/python-tic-tac-toe-ai/</id>
      <link href="https://realpython.com/courses/python-tic-tac-toe-ai/"/>
      <updated>2024-01-16T14:00:00+00:00</updated>
      <summary>In this video course, you&#x27;ll create a universal game engine in Python for tic-tac-toe with two computer players, one of which will be an AI player using the powerful minimax algorithm. You&#x27;ll give your game library a text-based graphical interface and explore two front ends.</summary>
      <content type="html">
        &lt;p&gt;A classic childhood game is tic-tac-toe, also known as naughts and crosses. It&amp;rsquo;s simple and enjoyable, and coding a version of it with Python is an exciting project for a budding programmer. Now, adding some artificial intelligence (AI) using Python can make an old favorite even more thrilling.&lt;/p&gt;
&lt;p&gt;In this comprehensive tutorial, you&amp;rsquo;ll construct a flexible game engine. This engine will include an unbeatable computer player that employs the minimax algorithm to play tic-tac-toe flawlessly. Throughout the tutorial, you&amp;rsquo;ll explore concepts such as immutable class design, generic plug-in architecture, and modern Python coding practices and patterns.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this video course, you&amp;rsquo;ll learn how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Develop a reusable &lt;strong&gt;Python library&lt;/strong&gt; containing the tic-tac-toe game engine&lt;/li&gt;
&lt;li&gt;Create a Pythonic code style that accurately models the tic-tac-toe &lt;strong&gt;domain&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Implement various artificial players, including one using the powerful &lt;strong&gt;minimax algorithm&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Construct a text-based &lt;strong&gt;console front end&lt;/strong&gt; for the game, enabling human players to participate&lt;/li&gt;
&lt;li&gt;Discover effective strategies for &lt;strong&gt;optimizing performance&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Are you ready to embark on this step-by-step adventure of building an extensible game engine with an unbeatable AI player using the minimax algorithm?&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 #187: Serializing Data With Python &amp; Underscore Naming Conventions</title>
      <id>https://realpython.com/podcasts/rpp/187/</id>
      <link href="https://realpython.com/podcasts/rpp/187/"/>
      <updated>2024-01-12T12:00:00+00:00</updated>
      <summary>Do you need to transfer an extensive data collection for a science project? What&#x27;s the best way to send executable code over the wire for distributed processing? What are the different ways to serialize data in Python? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;Do you need to transfer an extensive data collection for a science project? What&#x27;s the best way to send executable code over the wire for distributed processing? What are the different ways to serialize data in Python? Christopher Trudeau is back on the show this week, bringing 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 Exercises: Functions and Loops</title>
      <id>https://realpython.com/courses/python-exercises-functions-loops/</id>
      <link href="https://realpython.com/courses/python-exercises-functions-loops/"/>
      <updated>2024-01-09T14:00:00+00:00</updated>
      <summary>In this Python Basics Exercises course, you&#x27;ll practice creating user-defined functions that you can execute multiple times in your code. Additionally, you&#x27;ll gain experience in repeating code using for and while loops.</summary>
      <content type="html">
        &lt;p&gt;As you learned in &lt;a href=&quot;https://realpython.com/courses/python-basics-functions-loops/&quot;&gt;Python Basics: Functions and Loops&lt;/a&gt;, functions serve as the fundamental building blocks in almost every Python program. They&amp;rsquo;re where the real action happens!&lt;/p&gt;
&lt;p&gt;You now know that functions are crucial for breaking down code into smaller, manageable chunks. They enable you to define actions that your program can execute repeatedly throughout your code. Instead of duplicating the same code whenever your program needs to accomplish a particular task, you can simply call the function.&lt;/p&gt;
&lt;p&gt;However, there are instances when you need to repeat certain code multiple times in a row. This is where loops become invaluable.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this Python Basics Exercises video course, you&amp;rsquo;ll practice:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Creating &lt;strong&gt;user-defined functions&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Implementing &lt;strong&gt;&lt;code&gt;for&lt;/code&gt; loops&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Getting &lt;strong&gt;user input&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Rounding&lt;/strong&gt; numbers&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This video course is part of the Python Basics series, which accompanies &lt;a href=&quot;https://realpython.com/products/python-basics-book/&quot;&gt;&lt;em&gt;Python Basics: A Practical Introduction to Python 3&lt;/em&gt;&lt;/a&gt;. You can also check out the other &lt;a href=&quot;https://realpython.com/learning-paths/python-basics/&quot;&gt;Python Basics courses&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;Note that you&amp;rsquo;ll be using &lt;a href=&quot;https://realpython.com/python-idle/&quot;&gt;IDLE&lt;/a&gt; to &lt;a href=&quot;https://realpython.com/interacting-with-python/&quot;&gt;interact with Python&lt;/a&gt; throughout this course.&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 #186: Exploring Python in Excel</title>
      <id>https://realpython.com/podcasts/rpp/186/</id>
      <link href="https://realpython.com/podcasts/rpp/186/"/>
      <updated>2024-01-05T12:00:00+00:00</updated>
      <summary>Are you interested in using your Python skills within Excel? Would you like to share a data science project or visualization as a single Office file? This week on the show, we speak with Principal Architect John Lam and Sr. Cloud Developer Advocate Sarah Kaiser from Microsoft about Python in Excel.</summary>
      <content type="html">
        &lt;p&gt;Are you interested in using your Python skills within Excel? Would you like to share a data science project or visualization as a single Office file? This week on the show, we speak with Principal Architect John Lam and Sr. Cloud Developer Advocate Sarah Kaiser from Microsoft about Python in Excel.&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>HTTP Requests With Python&#x27;s urllib.request</title>
      <id>https://realpython.com/courses/python-urllib-request/</id>
      <link href="https://realpython.com/courses/python-urllib-request/"/>
      <updated>2024-01-02T14:00:00+00:00</updated>
      <summary>In this video course, you&#x27;ll explore how to make HTTP requests using Python&#x27;s handy built-in module, urllib.request. You&#x27;ll try out examples and go over common errors, all while learning more about HTTP requests and Python in general.</summary>
      <content type="html">
        &lt;p&gt;If you need to perform HTTP requests using Python, then the widely used &lt;a href=&quot;https://docs.python-requests.org/en/latest/&quot;&gt;Requests&lt;/a&gt; library is often the way to go. However, if you prefer to use only standard-library Python and minimize dependencies, then you can turn to &lt;code&gt;urllib.request&lt;/code&gt; instead.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this video course, you&amp;rsquo;ll:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Learn the essentials of making basic &lt;a href=&quot;https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_and_response_messages_through_connections&quot;&gt;HTTP requests&lt;/a&gt; with &lt;code&gt;urllib.request&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Explore the inner workings of an &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/HTTP/Messages&quot;&gt;HTTP message&lt;/a&gt; and how &lt;code&gt;urllib.request&lt;/code&gt; represents it&lt;/li&gt;
&lt;li&gt;Grasp the concept of handling &lt;strong&gt;character encodings&lt;/strong&gt; in HTTP messages&lt;/li&gt;
&lt;li&gt;Understand common hiccups when using &lt;code&gt;urllib.request&lt;/code&gt; and learn how to resolve them&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you&amp;rsquo;re already familiar with HTTP requests such as &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET&quot;&gt;GET&lt;/a&gt; and &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST&quot;&gt;POST&lt;/a&gt;, then you&amp;rsquo;re well prepared for this video course. Additionally, you should have prior experience using Python to &lt;a href=&quot;https://realpython.com/read-write-files-python/&quot;&gt;read and write files&lt;/a&gt;, ideally using a &lt;a href=&quot;https://realpython.com/python-with-statement/&quot;&gt;context manager&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In the end, you&amp;rsquo;ll discover that making HTTP requests doesn&amp;rsquo;t have to be a frustrating experience, despite its reputation. Many of the challenges people face in this process stem from the inherent complexity of the Internet. The good news is that the &lt;code&gt;urllib.request&lt;/code&gt; module can help demystify much of this complexity.&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 #185: 2023 Real Python Tutorial &amp; Video Course Wrap-Up</title>
      <id>https://realpython.com/podcasts/rpp/185/</id>
      <link href="https://realpython.com/podcasts/rpp/185/"/>
      <updated>2023-12-29T12:00:00+00:00</updated>
      <summary>Three members of the Real Python team are joining us this week: Kate Finegan, Tappan Moore, and Philipp Acsany. We wanted to share a year-end wrap-up with tutorials, step-by-step projects, code conversations, and video courses that showcase what our team created this year.</summary>
      <content type="html">
        &lt;p&gt;Three members of the Real Python team are joining us this week: Kate Finegan, Tappan Moore, and Philipp Acsany. We wanted to share a year-end wrap-up with tutorials, step-by-step projects, code conversations, and video courses that showcase what our team created this year.&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 #184: PyCoder&#x27;s Weekly 2023 Wrap Up</title>
      <id>https://realpython.com/podcasts/rpp/184/</id>
      <link href="https://realpython.com/podcasts/rpp/184/"/>
      <updated>2023-12-22T12:00:00+00:00</updated>
      <summary>It&#x27;s been a fascinating year for the Python language and community. PyCoder&#x27;s Weekly included over 1,500 links to articles, blog posts, tutorials, and projects in 2023. Christopher Trudeau is back on the show this week to help wrap up everything by sharing some highlights and Python trends from across the year.</summary>
      <content type="html">
        &lt;p&gt;It&#x27;s been a fascinating year for the Python language and community. PyCoder&#x27;s Weekly included over 1,500 links to articles, blog posts, tutorials, and projects in 2023. Christopher Trudeau is back on the show this week to help wrap up everything by sharing some highlights and Python trends from across the year.&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 Exercises: Reading and Writing Files</title>
      <id>https://realpython.com/courses/python-exercises-reading-writing-files/</id>
      <link href="https://realpython.com/courses/python-exercises-reading-writing-files/"/>
      <updated>2023-12-19T14:00:00+00:00</updated>
      <summary>In this video tutorial, you&#x27;ll practice transferring data between your Python programs and external software by reading and writing files. Through exercises, you&#x27;ll master the art of reading and writing information saved in CSV file format, which is extensively used for exchanging tabular data.</summary>
      <content type="html">
        &lt;p&gt;Files play a key role in computing, as they store and transfer data. You likely come across numerous files on a daily basis. In &lt;a href=&quot;https://realpython.com/courses/python-reading-and-writing-files/&quot;&gt;Python Basics: Reading and Writing Files&lt;/a&gt;, you dove into the world of file manipulation using Python.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this video course, you&amp;rsquo;ll practice:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Differentiating between &lt;strong&gt;text&lt;/strong&gt; and &lt;strong&gt;binary&lt;/strong&gt; files&lt;/li&gt;
&lt;li&gt;Using &lt;strong&gt;character encodings&lt;/strong&gt; and &lt;strong&gt;line endings&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Manipulating &lt;strong&gt;file objects&lt;/strong&gt; in Python&lt;/li&gt;
&lt;li&gt;Reading and writing character data with different &lt;strong&gt;file modes&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Using &lt;code&gt;open()&lt;/code&gt;, &lt;code&gt;Path.open()&lt;/code&gt;, and the &lt;code&gt;with&lt;/code&gt; statement&lt;/li&gt;
&lt;li&gt;Leveraging the &lt;code&gt;csv&lt;/code&gt; module to manipulate &lt;strong&gt;CSV data&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This video course is part of the Python Basics series, which is complements the book &lt;a href=&quot;https://realpython.com/products/python-basics-book/&quot;&gt;&lt;em&gt;Python Basics: A Practical Introduction to Python 3&lt;/em&gt;&lt;/a&gt;. Additionally, you can explore other &lt;a href=&quot;https://realpython.com/learning-paths/python-basics/&quot;&gt;Python Basics courses&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Please note that throughout this course, you&amp;rsquo;ll be using &lt;a href=&quot;https://realpython.com/python-idle/&quot;&gt;IDLE&lt;/a&gt; to &lt;a href=&quot;https://realpython.com/interacting-with-python/&quot;&gt;interact with Python&lt;/a&gt;. If you&amp;rsquo;re new to Python, then you might want to check out &lt;a href=&quot;https://realpython.com/courses/setting-up-python/&quot;&gt;Python Basics: Setting Up Python&lt;/a&gt; before diving into this course.&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 Exercises: Strings and String Methods</title>
      <id>https://realpython.com/courses/python-exercises-string-methods/</id>
      <link href="https://realpython.com/courses/python-exercises-string-methods/"/>
      <updated>2023-12-12T14:00:00+00:00</updated>
      <summary>In this Python Basics Exercises course, you&#x27;ll review how to work with the string data type. You&#x27;ll practice manipulating strings with methods and formatting them for printing.</summary>
      <content type="html">
        &lt;p&gt;In &lt;a href=&quot;https://realpython.com/courses/python-basics-strings-string-methods/&quot;&gt;Python Basics: Strings and String Methods&lt;/a&gt;,
you used &lt;strong&gt;strings&lt;/strong&gt; for text data in Python. You also learned how to manipulate strings with &lt;strong&gt;string methods&lt;/strong&gt;.
For example, you changed strings from lowercase to uppercase, 
removed whitespace from the beginning or end of a string, and replaced
parts of a string with different text.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this video course, you&amp;rsquo;ll practice:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Manipulating strings with &lt;strong&gt;string methods&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Working with &lt;strong&gt;user input&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Dealing with strings of &lt;strong&gt;numbers&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Formatting&lt;/strong&gt; strings for printing&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This video course is part of the Python Basics series, which accompanies &lt;a href=&quot;https://realpython.com/products/python-basics-book/&quot;&gt;&lt;em&gt;Python Basics: A Practical Introduction to Python 3&lt;/em&gt;&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;Note that you&amp;rsquo;ll be using &lt;a href=&quot;https://realpython.com/python-idle/&quot;&gt;IDLE&lt;/a&gt; to &lt;a href=&quot;https://realpython.com/interacting-with-python/&quot;&gt;interact with Python&lt;/a&gt; throughout this course. If you&amp;rsquo;re just getting started, then you might want to check out &lt;a href=&quot;https://realpython.com/courses/setting-up-python/&quot;&gt;Python Basics: Setting Up Python&lt;/a&gt; before diving into this course.&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 #183: Exploring Code Reviews in Python and Automating the Process</title>
      <id>https://realpython.com/podcasts/rpp/183/</id>
      <link href="https://realpython.com/podcasts/rpp/183/"/>
      <updated>2023-12-08T12:00:00+00:00</updated>
      <summary>What goes into a code review in Python? Is there a difference in how a large organization practices code review compared to a smaller one? What do you do if you&#x27;re a solo developer? This week on the show, Brendan Maginnis and Nick Thapen from Sourcery return to talk about code review and automated code assistance.</summary>
      <content type="html">
        &lt;p&gt;What goes into a code review in Python? Is there a difference in how a large organization practices code review compared to a smaller one? What do you do if you&#x27;re a solo developer? This week on the show, Brendan Maginnis and Nick Thapen from Sourcery return to talk about code review and automated code assistance.&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 Get the Current Time in Python</title>
      <id>https://realpython.com/courses/python-get-current-time/</id>
      <link href="https://realpython.com/courses/python-get-current-time/"/>
      <updated>2023-12-05T14:00:00+00:00</updated>
      <summary>In this video course, you&#x27;ll be getting the current time in Python. You&#x27;ll get your hands on a datetime object that represents the current time. You&#x27;ll see how to format it according to international standards, and you&#x27;ll even check out how computers represent time.</summary>
      <content type="html">
        &lt;p&gt;Getting the &lt;strong&gt;current time&lt;/strong&gt; in Python is a nice starting point for many time-related operations. One very important use case is creating &lt;a href=&quot;https://en.wikipedia.org/wiki/Timestamp&quot;&gt;timestamps&lt;/a&gt;. In this tutorial, you&amp;rsquo;ll learn how to &lt;strong&gt;get&lt;/strong&gt;, &lt;strong&gt;display&lt;/strong&gt;, and &lt;strong&gt;format&lt;/strong&gt; the current time with the &lt;a href=&quot;https://docs.python.org/3/library/datetime.html&quot;&gt;&lt;code&gt;datetime&lt;/code&gt;&lt;/a&gt; module.&lt;/p&gt;
&lt;p&gt;To effectively use the current time in your Python applications, you&amp;rsquo;ll add a few tools to your belt. For instance, you&amp;rsquo;ll learn how to &lt;strong&gt;read attributes&lt;/strong&gt; of the current time, like the year, minutes, or seconds. To make the time more easily readable, you&amp;rsquo;ll explore options for &lt;strong&gt;printing&lt;/strong&gt; it. You&amp;rsquo;ll also get to know different &lt;strong&gt;formats&lt;/strong&gt; of time and understand how to deal with &lt;strong&gt;time zones&lt;/strong&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>
  

</feed>
