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

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

  
    <entry>
      <title>A Python Guide to the Fibonacci Sequence</title>
      <id>https://realpython.com/fibonacci-sequence-python/</id>
      <link href="https://realpython.com/fibonacci-sequence-python/"/>
      <updated>2021-09-08T14:00:00+00:00</updated>
      <summary>In this step-by-step tutorial, you&#x27;ll explore the Fibonacci sequence in Python, which serves as an invaluable springboard into the world of recursion, and learn how to optimize recursive algorithms in the process.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;The &lt;strong&gt;Fibonacci sequence&lt;/strong&gt; is a prime example of &lt;a href=&quot;https://realpython.com/python-recursion/&quot;&gt;recursion&lt;/a&gt;, and learning it is an essential step in the pragmatic programmer’s journey toward mastering recursion. Even though you’ll focus on learning it using Python in this tutorial, you can apply these concepts universally to any programming language.&lt;/p&gt;
&lt;p&gt;As you perform an in-depth analysis on this famous recursive sequence, it will help you to better grasp and internalize the main concepts of recursion. You’ll even go a step further by learning how to optimize the Fibonacci sequence in Python, and recursive algorithms in general, by making them more time efficient.&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 the &lt;strong&gt;Fibonacci sequence&lt;/strong&gt; is&lt;/li&gt;
&lt;li&gt;What &lt;strong&gt;recursion&lt;/strong&gt; is &lt;/li&gt;
&lt;li&gt;How to optimize the Fibonacci sequence using a &lt;strong&gt;callable class&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to optimize the Fibonacci sequence &lt;strong&gt;iteratively&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to visualize recursion using a &lt;strong&gt;call stack&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To get the most out of this tutorial, you should know the basics of &lt;a href=&quot;https://realpython.com/sorting-algorithms-python/#measuring-efficiency-with-big-o-notation&quot;&gt;Big O notation&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python3-object-oriented-programming/&quot;&gt;object-oriented programming&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/operator-function-overloading/#the-internals-of-operations-like-len-and&quot;&gt;Python’s built-in methods&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-conditional-statements/&quot;&gt;control flow statements&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/defining-your-own-python-function/&quot;&gt;function calls&lt;/a&gt;, and &lt;a href=&quot;https://realpython.com/python-data-structures/&quot;&gt;basic data structures&lt;/a&gt; like lists, queues, and stacks. Having even some familiarity with these concepts will greatly help you understand the new ones you’ll be exploring in this tutorial.&lt;/p&gt;
&lt;p&gt;Let’s dive right in!&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&gt;Free Download:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-basics-sample-download/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-basics-sample-download&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Get a sample chapter from Python Basics: A Practical Introduction to Python 3&lt;/a&gt; to see how you can go from beginner to intermediate in Python with a complete curriculum, up-to-date for Python 3.8.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;what-is-the-fibonacci-sequence&quot;&gt;What Is the Fibonacci Sequence?&lt;a class=&quot;headerlink&quot; href=&quot;#what-is-the-fibonacci-sequence&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://www.britannica.com/biography/Fibonacci&quot;&gt;Leonardo Fibonacci&lt;/a&gt; was an Italian mathematician who was able to quickly produce an answer to this question asked by Emperor Frederick II of Swabia: “How many pairs of rabbits are obtained in a year, excluding cases of death, supposing that each couple gives birth to another couple every month and that the youngest couples are able to reproduce already at the second month of life?”&lt;/p&gt;
&lt;p&gt;The answer was the following sequence:&lt;/p&gt;
&lt;figure class=&quot;&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid mx-auto d-block w-75&quot; src=&quot;https://files.realpython.com/media/9645419cf728c44cf0bd28ab667f69aa.017fa332ab15.png&quot; width=&quot;2724&quot; height=&quot;109&quot; srcset=&quot;https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/9645419cf728c44cf0bd28ab667f69aa.017fa332ab15.png&amp;amp;w=681&amp;amp;sig=0b595e92a2fe83aa2bbdf9f6ac5b659e7db18ef0 681w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/9645419cf728c44cf0bd28ab667f69aa.017fa332ab15.png&amp;amp;w=1362&amp;amp;sig=504db41e40099ac6a7eaabad2bbca50452f98468 1362w, https://files.realpython.com/media/9645419cf728c44cf0bd28ab667f69aa.017fa332ab15.png 2724w&quot; sizes=&quot;75vw&quot; alt=&quot;Fibonacci recurrence relation starting with 0&quot; data-asset=&quot;3766&quot;&gt;&lt;/figure&gt;

&lt;p&gt;The pattern begins after the first two numbers, 0 and 1, where each number in the sequence is always the sum of the two numbers before it. Indian mathematicians had known about this sequence since the sixth century, and Fibonacci leveraged it to calculate the growth of rabbit populations.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;F&lt;/em&gt;(&lt;em&gt;n&lt;/em&gt;) is used to indicate the number of pairs of rabbits present in month &lt;em&gt;n&lt;/em&gt;, so the sequence can be expressed like this: &lt;/p&gt;
&lt;figure class=&quot;&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid mx-auto d-block w-50&quot; src=&quot;https://files.realpython.com/media/mwong-fibonacci-recurrence-relation.09c03cec1b7d.png&quot; width=&quot;1146&quot; height=&quot;332&quot; srcset=&quot;https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/mwong-fibonacci-recurrence-relation.09c03cec1b7d.png&amp;amp;w=286&amp;amp;sig=9a97942fc22f1130cf95db62923918a5ceaa8a33 286w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/mwong-fibonacci-recurrence-relation.09c03cec1b7d.png&amp;amp;w=573&amp;amp;sig=e70b1b5b487be72c05f429dca7f7706e7ba61551 573w, https://files.realpython.com/media/mwong-fibonacci-recurrence-relation.09c03cec1b7d.png 1146w&quot; sizes=&quot;75vw&quot; alt=&quot;The Fibonacci sequence described as a recurrence relation. F(0) and F(1) are defined to be 0, and the nth Fibonacci number is the sum of F(n-1) and F(n-2)&quot; data-asset=&quot;3721&quot;&gt;&lt;/figure&gt;

&lt;p&gt;In mathematical terminology, you’d call this a &lt;a href=&quot;https://en.wikipedia.org/wiki/Recurrence_relation&quot;&gt;recurrence relation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;There is also a version of the sequence where the first two numbers are both 1, like so: &lt;/p&gt;
&lt;figure class=&quot;&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid mx-auto d-block w-75&quot; src=&quot;https://files.realpython.com/media/403b57adc167e9addd094b3b2d3540bb.ba099fd0fdc9.png&quot; width=&quot;2600&quot; height=&quot;109&quot; srcset=&quot;https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/403b57adc167e9addd094b3b2d3540bb.ba099fd0fdc9.png&amp;amp;w=650&amp;amp;sig=189dae4173bee083facad91c750beb942b49db0c 650w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/403b57adc167e9addd094b3b2d3540bb.ba099fd0fdc9.png&amp;amp;w=1300&amp;amp;sig=c7f884a5e37b7491edd3962407328172a871b208 1300w, https://files.realpython.com/media/403b57adc167e9addd094b3b2d3540bb.ba099fd0fdc9.png 2600w&quot; sizes=&quot;75vw&quot; alt=&quot;Fibonacci sequence starting with 11&quot; data-asset=&quot;3767&quot;&gt;&lt;/figure&gt;

&lt;p&gt;In this case, &lt;em&gt;F&lt;/em&gt;(0) is still implicitly 0, but you start from &lt;em&gt;F&lt;/em&gt;(1) and &lt;em&gt;F&lt;/em&gt;(2) instead. The algorithm remains the same because you are always summing the previous two numbers to get the next number in the sequence.&lt;/p&gt;
&lt;p&gt;For the purposes of this tutorial, you’ll use the sequence that starts with 0.&lt;/p&gt;
&lt;h3 id=&quot;exploring-recursion&quot;&gt;Exploring Recursion&lt;a class=&quot;headerlink&quot; href=&quot;#exploring-recursion&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The Fibonacci sequence is a quintessential recursive problem. &lt;strong&gt;Recursion&lt;/strong&gt; is when a function calls itself in order to break down the problem it’s trying to solve. In every function call, the problem becomes smaller until it reaches a &lt;strong&gt;base case&lt;/strong&gt;, after which it will then return the result to each caller until it &lt;a href=&quot;https://realpython.com/python-return-statement/&quot;&gt;returns&lt;/a&gt; the final result back to the original caller. &lt;/p&gt;
&lt;p&gt;If you wanted to calculate the fifth Fibonacci number, &lt;em&gt;F&lt;/em&gt;(5), you would have to calculate its predecessors, &lt;em&gt;F&lt;/em&gt;(4) and &lt;em&gt;F&lt;/em&gt;(3), first. And in order to calculate &lt;em&gt;F&lt;/em&gt;(4) and &lt;em&gt;F&lt;/em&gt;(3), you would need to calculate their predecessors. The breakdown of &lt;em&gt;F&lt;/em&gt;(5) into smaller subproblems would look like this:&lt;/p&gt;
&lt;figure class=&quot;&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid mx-auto d-block w-66&quot; src=&quot;https://files.realpython.com/media/mwong-fib5.afb4734df50f.png&quot; width=&quot;2069&quot; height=&quot;687&quot; srcset=&quot;https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/mwong-fib5.afb4734df50f.png&amp;amp;w=517&amp;amp;sig=f451c9f9e5fb6bb9cbe7e91d728cb488cbedc990 517w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/mwong-fib5.afb4734df50f.png&amp;amp;w=1034&amp;amp;sig=f1b9d2cee91c433a645d16711b95f510221df551 1034w, https://files.realpython.com/media/mwong-fib5.afb4734df50f.png 2069w&quot; sizes=&quot;75vw&quot; alt=&quot;How to calculate the fifth Fibonacci number&quot; data-asset=&quot;3720&quot;&gt;&lt;/figure&gt;

&lt;p&gt;Each time the Fibonacci function is called, it gets broken down into two smaller subproblems because that is how you defined the recurrence relation. When it reaches the base case of either &lt;em&gt;F&lt;/em&gt;(0) or &lt;em&gt;F&lt;/em&gt;(1), it can finally return a result back to its caller. &lt;/p&gt;
&lt;p&gt;In order to calculate the fifth number in the Fibonacci sequence, you solve smaller but identical problems until you reach the base cases, where you can start returning a result:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/fibonacci-sequence-python/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/fibonacci-sequence-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>Graph Your Data With Python and ggplot</title>
      <id>https://realpython.com/courses/graph-data-with-python-and-ggplot/</id>
      <link href="https://realpython.com/courses/graph-data-with-python-and-ggplot/"/>
      <updated>2021-09-07T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll learn how to use ggplot in Python to build data visualizations with plotnine. You&#x27;ll discover what a grammar of graphics is and how it can help you create plots in a very concise and consistent way.</summary>
      <content type="html">
        &lt;p&gt;In this course, you&amp;rsquo;ll learn how to use &lt;code&gt;ggplot&lt;/code&gt; in Python to create data visualizations using a &lt;strong&gt;grammar of graphics&lt;/strong&gt;. A grammar of graphics is a high-level tool that allows you to create data plots in an efficient and consistent way. It abstracts most low-level details, letting you focus on creating meaningful and beautiful visualizations for your data. &lt;/p&gt;
&lt;p&gt;There are several Python packages that provide a grammar of graphics. This course focuses on &lt;strong&gt;plotnine&lt;/strong&gt; since it&amp;rsquo;s one of the most mature ones. plotnine is based on &lt;a href=&quot;https://ggplot2.tidyverse.org/&quot;&gt;&lt;code&gt;ggplot2&lt;/code&gt;&lt;/a&gt; from the R programming language, so if you have a background in R, then you can consider plotnine as the equivalent of &lt;code&gt;ggplot2&lt;/code&gt; in Python.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll learn how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Install &lt;strong&gt;plotnine&lt;/strong&gt; and &lt;strong&gt;Jupyter Notebook&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Combine the different elements of the &lt;strong&gt;grammar of graphics&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Use plotnine to &lt;strong&gt;create visualizations&lt;/strong&gt; in an efficient and consistent way&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Export&lt;/strong&gt; your data visualizations to files&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This course assumes that you already have &lt;a href=&quot;https://realpython.com/products/python-basics-book/&quot;&gt;some experience in Python&lt;/a&gt; and at least some knowledge of &lt;strong&gt;Jupyter Notebook&lt;/strong&gt; and &lt;strong&gt;pandas&lt;/strong&gt;. To get up to speed on these topics, check out &lt;a href=&quot;https://realpython.com/jupyter-notebook-introduction/&quot;&gt;Jupyter Notebook: An Introduction&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/pandas-python-explore-dataset/&quot;&gt;Using Pandas and Python to Explore Your Dataset&lt;/a&gt;.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>How Long Does It Take to Learn Python?</title>
      <id>https://realpython.com/how-long-does-it-take-to-learn-python/</id>
      <link href="https://realpython.com/how-long-does-it-take-to-learn-python/"/>
      <updated>2021-09-06T14:00:00+00:00</updated>
      <summary>In this article, you&#x27;ll assess whether or not learning Python is a good investment of your time, how long it will take you, and what background factors you need to consider when planning your learning journey. You&#x27;ll also learn what resources exist that can help you get started.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;You’ve probably found at least one blog post where the author reveals that they learned Python in a handful of days and quickly transitioned into a high-paying job. Some of these stories may be true, but they don’t help you prepare for a steady learning marathon. So, how long does it &lt;em&gt;really&lt;/em&gt; take to learn Python, and is it worth your time investment?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this article, you’ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What “learning Python” means and how you can &lt;strong&gt;measure your progress&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;What different &lt;strong&gt;reasons&lt;/strong&gt; there are for learning Python&lt;/li&gt;
&lt;li&gt;What &lt;strong&gt;background factors&lt;/strong&gt; affect your learning approach and outcome&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;How much time&lt;/strong&gt; you’ll want to invest in learning Python at &lt;strong&gt;different skill levels&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Which &lt;strong&gt;resources&lt;/strong&gt; you can use to improve your learning process&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To get started, you’ll go over some different reasons people want to learn to program in Python. Keep your personal motivations in mind and identify where you place yourself. Your reasons for learning Python will impact both your approach and the amount of time you’ll need to set aside.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&gt;Free Download:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-tricks-sample-pdf/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-tricks-sample-pdf&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Get a sample chapter from Python Tricks: The Book&lt;/a&gt; that shows you Python’s best practices with simple examples you can apply instantly to write more beautiful + Pythonic code.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;why-would-you-learn-python&quot;&gt;Why Would You Learn Python?&lt;a class=&quot;headerlink&quot; href=&quot;#why-would-you-learn-python&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;You might be completely new to programming and on the fence about whether or not you should invest your time into learning Python. In this first section, you’ll think about the different reasons people want to learn this programming language. Take note of the one you identify with the most:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Career and job opportunities:&lt;/strong&gt; Maybe you want to start a new career as a software developer. Maybe you want to keep working at your current company and transition into a more technical role, such as data analysis. Programming proficiency is an excellent addition to any skill set you already have. Once you have the Python skills you need, you can ace your &lt;a href=&quot;https://realpython.com/learning-paths/python-interview/&quot;&gt;Python coding interview&lt;/a&gt; to get your dream job.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Automation:&lt;/strong&gt; Python can help you automate repetitive tasks that you regularly do in your job and private life. You could learn to automate your work with &lt;a href=&quot;https://realpython.com/openpyxl-excel-spreadsheets-python/&quot;&gt;Excel spreadsheets&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/beautiful-soup-web-scraper-python/&quot;&gt;build a web scraper&lt;/a&gt; to access public data from the Internet, create &lt;a href=&quot;https://realpython.com/command-line-interfaces-python-argparse/&quot;&gt;command-line interfaces&lt;/a&gt;, or build bots for &lt;a href=&quot;https://realpython.com/twitter-bot-python-tweepy/&quot;&gt;Twitter&lt;/a&gt; or &lt;a href=&quot;https://realpython.com/how-to-make-a-discord-bot-python/&quot;&gt;Discord&lt;/a&gt; that take work off your plate.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Curiosity:&lt;/strong&gt; Digital products are everywhere, and you probably use them daily. You might want to know how your digital thermometer works, how a popular website is built, or how your favorite computer game would look if you digitally took it apart.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Creativity:&lt;/strong&gt; You might have some fantastic ideas for your own games, and you could build them &lt;a href=&quot;https://realpython.com/platformer-python-arcade/&quot;&gt;with Arcade&lt;/a&gt; or &lt;a href=&quot;https://realpython.com/asteroids-game-python/&quot;&gt;with Pygame&lt;/a&gt;. Or you may want to get started with &lt;a href=&quot;https://realpython.com/micropython/&quot;&gt;programming hardware&lt;/a&gt; for home automation, Internet of Things (IoT), or &lt;a href=&quot;https://realpython.com/embedded-python/&quot;&gt;embedded game development&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;All of these are great reasons to get into programming! Your personal motivation for starting on this journey will affect how fast and how deeply you’ll learn Python. It’ll also influence which aspects of the language will require your focus. If you’re looking for inspiration on topics to tackle, then you can read about &lt;a href=&quot;https://realpython.com/what-can-i-do-with-python/&quot;&gt;what you can do with Python&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;what-does-learning-python-mean&quot;&gt;What Does “Learning Python” Mean?&lt;a class=&quot;headerlink&quot; href=&quot;#what-does-learning-python-mean&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Learning Python means more than just learning the Python programming language. You’ll need to know more than just the specifics of a single programming language to do something useful with your programming skills. At the same time, you don’t need to understand every single aspect of Python to be productive.&lt;/p&gt;
&lt;p&gt;Learning Python is about learning how to accomplish practical tasks with Python programming. It’s about a skill set that you can use to build projects for yourself or an employer.&lt;/p&gt;
&lt;h2 id=&quot;how-can-you-measure-your-learning-progress&quot;&gt;How Can You Measure Your Learning Progress?&lt;a class=&quot;headerlink&quot; href=&quot;#how-can-you-measure-your-learning-progress&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;It’s often hard to say at what point you’ve fully learned something. Do you know Python when you know its syntax? Have you learned it when you know how to use a popular library without looking it up online? Or do you need to know all the ins and outs of the Python ecosystem to be able to say that you’ve learned Python?&lt;/p&gt;
&lt;p&gt;Realistically, you’ll probably never learn all there is to know about the Python ecosystem. There’s too much to know! Therefore, it’s helpful to separate your journey into different segments. This approach makes it easier for you to keep moving in the right direction.&lt;/p&gt;
&lt;p&gt;When you think about different skill levels, you might think of three traditional categories:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Beginner&lt;/li&gt;
&lt;li&gt;Intermediate&lt;/li&gt;
&lt;li&gt;Expert&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;However, it’s hard to define when someone stops being a beginner, and even experienced programmers often don’t consider themselves experts. On the other hand, some programmers with low ability may think of themselves as experts, a cognitive bias known as the &lt;a href=&quot;https://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect&quot;&gt;Dunning-Kruger effect&lt;/a&gt;. With that in mind, mapping out your progress following this type of traditional classification might not be that useful for you.&lt;/p&gt;
&lt;h3 id=&quot;the-four-stages-of-competence&quot;&gt;The Four Stages of Competence&lt;a class=&quot;headerlink&quot; href=&quot;#the-four-stages-of-competence&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Instead, you’ll use a different framework that  follows the &lt;a href=&quot;https://en.wikipedia.org/wiki/Four_stages_of_competence&quot;&gt;four stages of competence&lt;/a&gt; for assessing your learning progress:&lt;/p&gt;
&lt;figure class=&quot;js-lightbox&quot;&gt;&lt;a href=&quot;https://files.realpython.com/media/four-stages.d678c620edb0.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/four-stages.d678c620edb0.png&quot; width=&quot;3356&quot; height=&quot;619&quot; srcset=&quot;https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/four-stages.d678c620edb0.png&amp;amp;w=839&amp;amp;sig=a4ced5af7d8b46818ad2430bc0b6820918551b52 839w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/four-stages.d678c620edb0.png&amp;amp;w=1678&amp;amp;sig=0dfa356d24bba0243aba26d810cf68f637f28c1a 1678w, https://files.realpython.com/media/four-stages.d678c620edb0.png 3356w&quot; sizes=&quot;75vw&quot; alt=&quot;The four stages of competence&quot; data-asset=&quot;3761&quot;&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;To make the four stages of competence more accessible, you’ll see the following short names to refer to each of the four stages:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Unawareness&lt;/strong&gt; for &lt;strong&gt;unconscious incompetence&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Awareness&lt;/strong&gt; for &lt;strong&gt;conscious incompetence&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ability&lt;/strong&gt; for &lt;strong&gt;conscious competence&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Expertise&lt;/strong&gt; for &lt;strong&gt;unconscious competence&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/how-long-does-it-take-to-learn-python/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/how-long-does-it-take-to-learn-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 #76: Harnessing Python&#x27;s math Module and Exposing Practical Pandas Functions</title>
      <id>https://realpython.com/podcasts/rpp/76/</id>
      <link href="https://realpython.com/podcasts/rpp/76/"/>
      <updated>2021-09-03T12:00:00+00:00</updated>
      <summary>How well do you know Python&#x27;s math module? Maybe you&#x27;ve used a few of the constants or arithmetic functions. You may be surprised by the amount of functionality hiding within this built-in library, and perhaps you don&#x27;t need to reach for an additional outside library. This week on the show, David Amos is back, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;How well do you know Python&#x27;s math module? Maybe you&#x27;ve used a few of the constants or arithmetic functions. You may be surprised by the amount of functionality hiding within this built-in library, and perhaps you don&#x27;t need to reach for an additional outside library. This week on the show, David Amos is back, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Splitting Datasets With scikit-learn and train_test_split()</title>
      <id>https://realpython.com/courses/splitting-datasets-scikit-learn-train-test-split/</id>
      <link href="https://realpython.com/courses/splitting-datasets-scikit-learn-train-test-split/"/>
      <updated>2021-08-31T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll learn why it&#x27;s important to split your dataset in supervised machine learning and how to do that with train_test_split() from scikit-learn.</summary>
      <content type="html">
        &lt;p&gt;One of the key aspects of supervised &lt;a href=&quot;https://realpython.com/learning-paths/machine-learning-python/&quot;&gt;machine learning&lt;/a&gt; is model evaluation and validation. When you evaluate the predictive performance of your model, it&amp;rsquo;s essential that the process be unbiased. Using &lt;a href=&quot;https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.train_test_split.html&quot;&gt;&lt;strong&gt;&lt;code&gt;train_test_split()&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; from the data science library &lt;a href=&quot;https://scikit-learn.org/stable/index.html&quot;&gt;scikit-learn&lt;/a&gt;, you can split your dataset into subsets that minimize the potential for bias in your evaluation and validation process.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Why you need to &lt;strong&gt;split your dataset&lt;/strong&gt; in supervised machine learning&lt;/li&gt;
&lt;li&gt;Which &lt;strong&gt;subsets&lt;/strong&gt; of the dataset you need for an unbiased evaluation of your model&lt;/li&gt;
&lt;li&gt;How to use &lt;strong&gt;&lt;code&gt;train_test_split()&lt;/code&gt;&lt;/strong&gt; to split your data&lt;/li&gt;
&lt;li&gt;How to combine &lt;code&gt;train_test_split()&lt;/code&gt; with &lt;strong&gt;prediction methods&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In addition, you&amp;rsquo;ll get information on related tools from &lt;a href=&quot;https://scikit-learn.org/stable/modules/classes.html#module-sklearn.model_selection&quot;&gt;&lt;code&gt;sklearn.model_selection&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Using Python Optional Arguments When Defining Functions</title>
      <id>https://realpython.com/python-optional-arguments/</id>
      <link href="https://realpython.com/python-optional-arguments/"/>
      <updated>2021-08-30T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn about Python optional arguments and how to define functions with default values. You&#x27;ll also learn how to create functions that accept any number of arguments using args and kwargs.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Defining your own functions is an essential skill for writing clean and effective code. In this tutorial, you’ll explore the techniques you have available for defining Python functions that take optional arguments. When you master Python optional arguments, you’ll be able to define functions that are more powerful and more flexible.&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 the difference is between &lt;strong&gt;parameters&lt;/strong&gt; and &lt;strong&gt;arguments&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to define functions with &lt;strong&gt;optional arguments&lt;/strong&gt; and &lt;strong&gt;default parameter values&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to define functions using &lt;strong&gt;&lt;code&gt;args&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;kwargs&lt;/code&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to deal with &lt;strong&gt;error messages&lt;/strong&gt; about optional arguments&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To get the most out of this tutorial, you’ll need some familiarity with &lt;a href=&quot;https://realpython.com/defining-your-own-python-function/&quot;&gt;defining functions&lt;/a&gt; with required arguments.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Free Bonus:&lt;/strong&gt; &lt;a href=&quot;&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-cheat-sheet-shortened&quot; data-focus=&quot;false&quot;&gt;Click here to get a Python Cheat Sheet&lt;/a&gt; and learn the basics of Python 3, like working with data types, dictionaries, lists, and Python functions.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;creating-functions-in-python-for-reusing-code&quot;&gt;Creating Functions in Python for Reusing Code&lt;a class=&quot;headerlink&quot; href=&quot;#creating-functions-in-python-for-reusing-code&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;You can think of a function as a mini-program that runs within another program or within another function. The main program calls the mini-program and sends information that the mini-program will need as it runs. When the function completes all of its actions, it may send some data back to the main program that has called it.&lt;/p&gt;
&lt;p&gt;The primary purpose of a function is to allow you to reuse the code within it whenever you need it, using different inputs if required.&lt;/p&gt;
&lt;p&gt;When you use functions, you are extending your Python vocabulary. This lets you express the solution to your problem in a clearer and more succinct way.&lt;/p&gt;
&lt;p&gt;In Python, by convention, you should name a function using lowercase letters with words separated by an underscore, such as &lt;code&gt;do_something()&lt;/code&gt;. These conventions are described in &lt;a href=&quot;https://www.python.org/dev/peps/pep-0008/&quot;&gt;PEP 8&lt;/a&gt;, which is Python’s style guide. You’ll need to add parentheses after the function name when you call it. Since functions represent actions, it’s a best practice to start your function names with a verb to make your code more readable.&lt;/p&gt;
&lt;h3 id=&quot;defining-functions-with-no-input-parameters&quot;&gt;Defining Functions With No Input Parameters&lt;a class=&quot;headerlink&quot; href=&quot;#defining-functions-with-no-input-parameters&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;In this tutorial, you’ll use the example of a basic program that creates and maintains a shopping list and &lt;a href=&quot;https://realpython.com/python-print/&quot;&gt;prints it out&lt;/a&gt; when you’re ready to go to the supermarket.&lt;/p&gt;
&lt;p&gt;Start by creating a shopping list:&lt;/p&gt;
&lt;div class=&quot;highlight python&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;shopping_list&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;s2&quot;&gt;&quot;Bread&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;Milk&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;Chocolate&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;Butter&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;Coffee&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You’re using a &lt;a href=&quot;https://realpython.com/python-dicts/&quot;&gt;dictionary&lt;/a&gt; to store the item name as the key and the quantity you need to buy of each item as the value. You can define a function to display the shopping list:&lt;/p&gt;
&lt;div class=&quot;highlight python&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;# optional_params.py&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;shopping_list&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;s2&quot;&gt;&quot;Bread&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;Milk&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;Chocolate&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;Butter&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;Coffee&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;show_list&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;():&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;item_name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;quantity&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;shopping_list&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;items&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;():&lt;/span&gt;
        &lt;span class=&quot;nb&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sa&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;quantity&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;x &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;item_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;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;show_list&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;When you run this script, you’ll get a printout of the shopping list:&lt;/p&gt;
&lt;div class=&quot;highlight sh&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python optional_params.py
&lt;span class=&quot;go&quot;&gt;1x Bread&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;2x Milk&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;1x Chocolate&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;1x Butter&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;1x Coffee&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The function you’ve defined has no input parameters as the parentheses in the function &lt;strong&gt;signature&lt;/strong&gt; are empty. The signature is the first line in the function definition:&lt;/p&gt;
&lt;div class=&quot;highlight python&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;show_list&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;():&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You don’t need any input parameters in this example since the dictionary &lt;code&gt;shopping_list&lt;/code&gt; is a &lt;strong&gt;global variable&lt;/strong&gt;. This means that it can be accessed from everywhere in the program, including from within the function definition. This is called the &lt;strong&gt;global scope&lt;/strong&gt;. You can read more about scope in &lt;a href=&quot;https://realpython.com/python-scope-legb-rule/&quot;&gt;Python Scope &amp;amp; the LEGB Rule: Resolving Names in Your Code&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Using global variables in this way is not a good practice. It can lead to several functions making changes to the same data structure, which can lead to bugs that are hard to find. You’ll see how to improve on this later on in this tutorial when you’ll pass the dictionary to the function as an argument.&lt;/p&gt;
&lt;p&gt;In the next section, you’ll define a function that has input parameters.&lt;/p&gt;
&lt;h3 id=&quot;defining-functions-with-required-input-arguments&quot;&gt;Defining Functions With Required Input Arguments&lt;a class=&quot;headerlink&quot; href=&quot;#defining-functions-with-required-input-arguments&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Instead of writing the shopping list directly in the code, you can now initialize an empty dictionary and write a function that allows you to add items to the shopping list:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-optional-arguments/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-optional-arguments/ »&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 #75: Building With CircuitPython &amp; Constraints of Python for Microcontrollers</title>
      <id>https://realpython.com/podcasts/rpp/75/</id>
      <link href="https://realpython.com/podcasts/rpp/75/"/>
      <updated>2021-08-27T12:00:00+00:00</updated>
      <summary>Can you make a version of Python that fits within the memory constraints of a microcontroller and have it still feel like Python? That is the intention behind CircuitPython. This week on the show, we have Scott Shawcroft, who is the project lead for CircuitPython.</summary>
      <content type="html">
        &lt;p&gt;Can you make a version of Python that fits within the memory constraints of a microcontroller and have it still feel like Python? That is the intention behind CircuitPython. This week on the show, we have Scott Shawcroft, who is the project lead for CircuitPython.&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>Exploring the Python math Module</title>
      <id>https://realpython.com/courses/exploring-python-math-module/</id>
      <link href="https://realpython.com/courses/exploring-python-math-module/"/>
      <updated>2021-08-24T14:00:00+00:00</updated>
      <summary>In this step-by-step course, you’ll learn all about Python’s math module for higher-level mathematical functions. Whether you’re working on a scientific project, a financial application, or any other type of programming endeavor, you just can’t escape the need for math!</summary>
      <content type="html">
        &lt;p&gt;In this course, you&amp;rsquo;ll learn all about Python&amp;rsquo;s &lt;strong&gt;&lt;code&gt;math&lt;/code&gt;&lt;/strong&gt; module. Mathematical calculations are an essential part of most Python development. Whether you&amp;rsquo;re working on a scientific project, a financial application, or any other type of programming endeavor, you just can&amp;rsquo;t escape the need for math.&lt;/p&gt;
&lt;p&gt;For straightforward mathematical calculations in Python, you can use the built-in mathematical &lt;strong&gt;operators&lt;/strong&gt;, such as addition (&lt;code&gt;+&lt;/code&gt;), subtraction (&lt;code&gt;-&lt;/code&gt;), division (&lt;code&gt;/&lt;/code&gt;), and multiplication (&lt;code&gt;*&lt;/code&gt;). But more advanced operations, such as exponential, logarithmic, trigonometric, or power functions, are not built in. Does that mean you need to implement all of these functions from scratch?&lt;/p&gt;
&lt;p&gt;Fortunately, no. Python provides a &lt;a href=&quot;https://realpython.com/python-modules-packages/&quot;&gt;module&lt;/a&gt; specifically designed for higher-level mathematical operations: the &lt;code&gt;math&lt;/code&gt; module.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this course, you&amp;rsquo;ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What the Python &lt;code&gt;math&lt;/code&gt; module is&lt;/li&gt;
&lt;li&gt;How to use &lt;code&gt;math&lt;/code&gt; module functions to solve real-life problems&lt;/li&gt;
&lt;li&gt;What the constants of the &lt;code&gt;math&lt;/code&gt; module are, including pi, tau, and Euler&amp;rsquo;s number&lt;/li&gt;
&lt;li&gt;What the differences between built-in functions and &lt;code&gt;math&lt;/code&gt; functions are&lt;/li&gt;
&lt;li&gt;What the differences between &lt;code&gt;math&lt;/code&gt;, &lt;code&gt;cmath&lt;/code&gt;, and NumPy are&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A background in mathematics will be helpful here, but don&amp;rsquo;t worry if math isn&amp;rsquo;t your strong suit. This course will explain the basics of everything you need to know.&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 deque: Implement Efficient Queues and Stacks</title>
      <id>https://realpython.com/python-deque/</id>
      <link href="https://realpython.com/python-deque/"/>
      <updated>2021-08-23T14:00:00+00:00</updated>
      <summary>In this step-by-step tutorial, you&#x27;ll learn about Python&#x27;s deque and how to use it to perform efficient pop and append operations on both ends of your sequences. Deques are commonly used to build queues and stacks.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;If you often work with lists in Python, then you probably know that they don’t perform fast enough when you need to &lt;strong&gt;pop&lt;/strong&gt; and &lt;strong&gt;append&lt;/strong&gt; items on their left end. Python’s &lt;a href=&quot;https://docs.python.org/3/library/collections.html#module-collections&quot;&gt;&lt;code&gt;collections&lt;/code&gt;&lt;/a&gt; module provides a class called &lt;a href=&quot;https://docs.python.org/3/library/collections.html#collections.deque&quot;&gt;&lt;code&gt;deque&lt;/code&gt;&lt;/a&gt; that’s specially designed to provide fast and memory-efficient ways to append and pop item from both ends of the underlying data structure.&lt;/p&gt;
&lt;p&gt;Python’s &lt;code&gt;deque&lt;/code&gt; is a low-level and highly optimized &lt;a href=&quot;https://en.wikipedia.org/wiki/Double-ended_queue&quot;&gt;double-ended queue&lt;/a&gt; that’s useful for implementing elegant, efficient, and Pythonic queues and stacks, which are the most common list-like data types in computing.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How to create and use Python’s &lt;strong&gt;&lt;code&gt;deque&lt;/code&gt;&lt;/strong&gt; in your code&lt;/li&gt;
&lt;li&gt;How to efficiently &lt;strong&gt;append&lt;/strong&gt; and &lt;strong&gt;pop&lt;/strong&gt; items from both ends of a &lt;code&gt;deque&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;How to use &lt;code&gt;deque&lt;/code&gt; to build efficient &lt;strong&gt;queues&lt;/strong&gt; and &lt;strong&gt;stacks&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;When it’s worth using &lt;strong&gt;&lt;code&gt;deque&lt;/code&gt;&lt;/strong&gt; instead of &lt;strong&gt;&lt;code&gt;list&lt;/code&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To better understand these topics, you should know the basics of working with Python &lt;a href=&quot;https://realpython.com/python-lists-tuples/&quot;&gt;lists&lt;/a&gt;. It’ll also be beneficial for you to have a general understanding of &lt;a href=&quot;https://realpython.com/python-data-structures/#queues-fifos&quot;&gt;queues&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/how-to-implement-python-stack/&quot;&gt;stacks&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Finally, you’ll write a few examples that walk you through some common use cases of &lt;code&gt;deque&lt;/code&gt;, which is one of Python’s most powerful data types.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&gt;Free Download:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-tricks-sample-pdf/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-tricks-sample-pdf&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Get a sample chapter from Python Tricks: The Book&lt;/a&gt; that shows you Python’s best practices with simple examples you can apply instantly to write more beautiful + Pythonic code.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;getting-started-with-pythons-deque&quot;&gt;Getting Started With Python’s &lt;code&gt;deque&lt;/code&gt;&lt;a class=&quot;headerlink&quot; href=&quot;#getting-started-with-pythons-deque&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Appending items to and popping them from the right end of a Python list are normally efficient operations. If you use the &lt;a href=&quot;https://en.wikipedia.org/wiki/Big_O_notation&quot;&gt;Big O notation&lt;/a&gt; for &lt;a href=&quot;https://wiki.python.org/moin/TimeComplexity&quot;&gt;time complexity&lt;/a&gt;, then you can say that they’re &lt;em&gt;O&lt;/em&gt;(1). However, when Python needs to reallocate memory to grow the underlying list for accepting new items, these operations are slower and can become &lt;em&gt;O&lt;/em&gt;(&lt;em&gt;n&lt;/em&gt;).&lt;/p&gt;
&lt;p&gt;Additionally, appending and popping items on the left end of a Python list are known to be inefficient operations with &lt;em&gt;O&lt;/em&gt;(&lt;em&gt;n&lt;/em&gt;) speed.&lt;/p&gt;
&lt;p&gt;Since Python lists provide both operations with &lt;a href=&quot;https://realpython.com/python-append/&quot;&gt;&lt;code&gt;.append()&lt;/code&gt;&lt;/a&gt; and &lt;code&gt;.pop()&lt;/code&gt;, they’re usable as &lt;a href=&quot;https://en.wikipedia.org/wiki/Stack_(abstract_data_type)&quot;&gt;stacks&lt;/a&gt; and &lt;a href=&quot;https://en.wikipedia.org/wiki/Queue_(abstract_data_type)&quot;&gt;queues&lt;/a&gt;. However, the performance issues you saw before can significantly affect the overall performance of your applications.&lt;/p&gt;
&lt;p&gt;Python’s &lt;a href=&quot;https://docs.python.org/3/library/collections.html?highlight=collections#collections.deque&quot;&gt;&lt;code&gt;deque&lt;/code&gt;&lt;/a&gt; was the first data type added to the &lt;a href=&quot;https://realpython.com/python-collections-module/&quot;&gt;&lt;code&gt;collections&lt;/code&gt;&lt;/a&gt; module back in &lt;a href=&quot;https://docs.python.org/3/whatsnew/2.4.html#new-improved-and-deprecated-modules&quot;&gt;Python 2.4&lt;/a&gt;. This data type was specially designed to overcome the efficiency problems of &lt;code&gt;.append()&lt;/code&gt; and &lt;code&gt;.pop()&lt;/code&gt; in Python list.&lt;/p&gt;
&lt;p&gt;Deques are sequence-like data types designed as a generalization of &lt;strong&gt;stacks&lt;/strong&gt; and &lt;strong&gt;queues&lt;/strong&gt;. They support memory-efficient and fast append and pop operations on both ends of the data structure.&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; &lt;code&gt;deque&lt;/code&gt; is pronounced as “deck.” The name stands for &lt;a href=&quot;https://en.wikipedia.org/wiki/Double-ended_queue&quot;&gt;&lt;strong&gt;d&lt;/strong&gt;ouble-&lt;strong&gt;e&lt;/strong&gt;nded &lt;strong&gt;que&lt;/strong&gt;ue&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Append and pop operations on both ends of a &lt;code&gt;deque&lt;/code&gt; object are stable and equally efficient because deques are &lt;a href=&quot;https://github.com/python/cpython/blob/23acadcc1c75eb74b2459304af70d97a35001b34/Modules/_collectionsmodule.c#L34&quot;&gt;implemented&lt;/a&gt; as a &lt;a href=&quot;https://realpython.com/linked-lists-python/#how-to-use-doubly-linked-lists&quot;&gt;doubly linked list&lt;/a&gt;. Additionally, append and pop operations on deques are also &lt;a href=&quot;https://en.wikipedia.org/wiki/Thread_safety&quot;&gt;thread safe&lt;/a&gt; and memory efficient. These features make deques particularly useful for creating custom stacks and queues in Python.&lt;/p&gt;
&lt;p&gt;Deques are also the way to go if you need to keep a list of last-seen items because you can restrict the maximum length of your deques. If you do so, then once a deque is full, it automatically discards items from one end when you append new items on the opposite end.&lt;/p&gt;
&lt;p&gt;Here’s a summary of the main characteristics of &lt;code&gt;deque&lt;/code&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Stores items of any &lt;a href=&quot;https://realpython.com/python-data-types/&quot;&gt;data type&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Is a &lt;a href=&quot;https://docs.python.org/3/glossary.html#term-mutable&quot;&gt;mutable&lt;/a&gt; data type&lt;/li&gt;
&lt;li&gt;Supports &lt;a href=&quot;https://realpython.com/python-boolean/#the-in-operator&quot;&gt;membership operations&lt;/a&gt; with the &lt;code&gt;in&lt;/code&gt; operator&lt;/li&gt;
&lt;li&gt;Supports &lt;a href=&quot;https://realpython.com/python-lists-tuples/#list-elements-can-be-accessed-by-index&quot;&gt;indexing&lt;/a&gt;, like in &lt;code&gt;a_deque[i]&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Doesn’t support slicing, like in &lt;code&gt;a_deque[0:2]&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Supports built-in functions that operate on sequences and iterables, such as &lt;a href=&quot;https://docs.python.org/3/library/functions.html#len&quot;&gt;&lt;code&gt;len()&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-sort/&quot;&gt;&lt;code&gt;sorted()&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-reverse-list/&quot;&gt;&lt;code&gt;reversed()&lt;/code&gt;&lt;/a&gt;, and more&lt;/li&gt;
&lt;li&gt;Doesn’t support &lt;a href=&quot;https://en.wikipedia.org/wiki/In-place_algorithm&quot;&gt;in-place&lt;/a&gt; sorting&lt;/li&gt;
&lt;li&gt;Supports normal and reverse iteration&lt;/li&gt;
&lt;li&gt;Supports pickling with &lt;a href=&quot;https://realpython.com/python-pickle-module/&quot;&gt;&lt;code&gt;pickle&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Ensures fast, memory-efficient, and thread-safe pop and append operations on both ends&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Creating &lt;code&gt;deque&lt;/code&gt; instances is a straightforward process. You just need to import &lt;code&gt;deque&lt;/code&gt; from &lt;code&gt;collections&lt;/code&gt; and call it with an optional &lt;code&gt;iterable&lt;/code&gt; as an argument:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;span class=&quot;repl-toggle&quot; title=&quot;Toggle REPL prompts and output&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;collections&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;deque&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;# Create an empty deque&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;deque&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;deque([])&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;# Use different iterables to create deques&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;deque&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;deque([1, 2, 3, 4])&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;deque&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;deque([1, 2, 3, 4])&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;deque&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&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;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;deque([1, 2, 3, 4])&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;deque&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;abcd&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;deque([&#x27;a&#x27;, &#x27;b&#x27;, &#x27;c&#x27;, &#x27;d&#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;numbers&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;s2&quot;&gt;&quot;one&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;two&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;three&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;four&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;deque&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;numbers&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;keys&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;deque([&#x27;one&#x27;, &#x27;two&#x27;, &#x27;three&#x27;, &#x27;four&#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;deque&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;numbers&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;values&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;deque([1, 2, 3, 4])&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;deque&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;numbers&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;items&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;deque([(&#x27;one&#x27;, 1), (&#x27;two&#x27;, 2), (&#x27;three&#x27;, 3), (&#x27;four&#x27;, 4)])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If you instantiate &lt;code&gt;deque&lt;/code&gt; without providing an &lt;code&gt;iterable&lt;/code&gt; as an argument, then you get an empty deque. If you provide and input &lt;code&gt;iterable&lt;/code&gt;, then &lt;code&gt;deque&lt;/code&gt; initializes the new instance with data from it. The initialization goes from left to right using &lt;a href=&quot;https://docs.python.org/3/library/collections.html#collections.deque.append&quot;&gt;&lt;code&gt;deque.append()&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;deque&lt;/code&gt; initializer takes the following two optional arguments:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;iterable&lt;/code&gt;&lt;/strong&gt; holds an iterable that provides the initialization data.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;maxlen&lt;/code&gt;&lt;/strong&gt; holds an integer &lt;a href=&quot;https://realpython.com/python-numbers/&quot;&gt;number&lt;/a&gt; that specifies the maximum length of the deque.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;As mentioned previously, if you don’t supply an &lt;code&gt;iterable&lt;/code&gt;, then you get an empty deque. If you supply a value to &lt;a href=&quot;https://docs.python.org/3/library/collections.html#collections.deque.maxlen&quot;&gt;&lt;code&gt;maxlen&lt;/code&gt;&lt;/a&gt;, then your deque will only store up to &lt;code&gt;maxlen&lt;/code&gt; items.&lt;/p&gt;
&lt;p&gt;Finally, you can also use unordered iterables, such as &lt;a href=&quot;https://realpython.com/python-sets/&quot;&gt;sets&lt;/a&gt;, to initialize your deques. In those cases, you won’t have a predefined order for the items in the final deque.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-deque/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-deque/ »&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 #74: Python&#x27;s Assignment Expressions and Fixing a Botched Release to PyPI</title>
      <id>https://realpython.com/podcasts/rpp/74/</id>
      <link href="https://realpython.com/podcasts/rpp/74/"/>
      <updated>2021-08-20T12:00:00+00:00</updated>
      <summary>Have you started to use Python&#x27;s assignment expression in your code? Maybe you have heard them called the walrus operator. Now that the controversy over the introduction in Python 3.8 has settled down, how can you use assignment expressions effectively in your code? This week on the show, David Amos is back, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;Have you started to use Python&#x27;s assignment expression in your code? Maybe you have heard them called the walrus operator. Now that the controversy over the introduction in Python 3.8 has settled down, how can you use assignment expressions effectively in your code? This week on the show, David Amos is back, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Reading and Writing Files With Pandas</title>
      <id>https://realpython.com/courses/reading-writing-files-pandas/</id>
      <link href="https://realpython.com/courses/reading-writing-files-pandas/"/>
      <updated>2021-08-17T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll learn about the Pandas IO tools API and how you can use it to read and write files. You&#x27;ll use the Pandas read_csv() function to work with CSV files. You&#x27;ll also cover similar methods for efficiently working with Excel, CSV, JSON, HTML, SQL, pickle, and big data files.</summary>
      <content type="html">
        &lt;p&gt;&lt;strong&gt;&lt;a href=&quot;https://pandas.pydata.org/&quot;&gt;Pandas&lt;/a&gt;&lt;/strong&gt; is a powerful and flexible Python package that allows you to work with labeled and time series data. It also provides &lt;a href=&quot;https://realpython.com/python-statistics/&quot;&gt;statistics&lt;/a&gt; methods, enables plotting, and more. One crucial feature of Pandas is its ability to write and read Excel, CSV, and many other types of files. Functions like the Pandas &lt;a href=&quot;https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_csv.html&quot;&gt;&lt;code&gt;read_csv()&lt;/code&gt;&lt;/a&gt; method enable you to work with files effectively. You can use them to save the data and labels from Pandas objects to a file and load them later as Pandas &lt;code&gt;Series&lt;/code&gt; or &lt;a href=&quot;https://realpython.com/pandas-dataframe/&quot;&gt;&lt;code&gt;DataFrame&lt;/code&gt;&lt;/a&gt; instances.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What the &lt;strong&gt;Pandas IO tools&lt;/strong&gt; API is&lt;/li&gt;
&lt;li&gt;How to &lt;strong&gt;read and write data&lt;/strong&gt; to and from files&lt;/li&gt;
&lt;li&gt;How to use the methods of &lt;strong&gt;read_csv()&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to work with various &lt;strong&gt;file formats&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to work with &lt;strong&gt;big data&lt;/strong&gt; efficiently&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Python News: What&#x27;s New From July 2021?</title>
      <id>https://realpython.com/python-news-july-2021/</id>
      <link href="https://realpython.com/python-news-july-2021/"/>
      <updated>2021-08-16T14:00:00+00:00</updated>
      <summary>The Python community saw some great changes in July 2021. In this article, you&#x27;ll get up to speed on the big-ticket items that happened this past month, including some news about the CPython Developer-in-Residence position at the Python Software Foundation.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;&lt;strong&gt;July 2021&lt;/strong&gt; was an exciting month for the Python community! The Python Software Foundation hired the first-ever &lt;strong&gt;CPython Developer-in-Residence&lt;/strong&gt;—a full-time paid position devoted to CPython development. In other news from the CPython developer team, &lt;a href=&quot;https://realpython.com/python-traceback/&quot;&gt;tracebacks&lt;/a&gt; and &lt;strong&gt;error messages&lt;/strong&gt; got some much-needed attention.&lt;/p&gt;
&lt;p&gt;Let’s dive into the biggest &lt;strong&gt;Python news&lt;/strong&gt; from the past month!&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Free Bonus:&lt;/strong&gt; &lt;a href=&quot;&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-cheat-sheet-shortened&quot; data-focus=&quot;false&quot;&gt;Click here to get a Python Cheat Sheet&lt;/a&gt; and learn the basics of Python 3, like working with data types, dictionaries, lists, and Python functions.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;cpython-has-a-full-time-developer-in-residence&quot;&gt;CPython Has a Full-Time Developer-in-Residence&lt;a class=&quot;headerlink&quot; href=&quot;#cpython-has-a-full-time-developer-in-residence&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In our &lt;a href=&quot;https://realpython.com/python-news-june-2021&quot;&gt;June news roundup&lt;/a&gt;, we featured the Python Software Foundation’s announcement that they were hiring a CPython Developer-in-Residence. In July, the PSF’s plans came to fruition with the hiring of Łukasz Langa.&lt;/p&gt;
&lt;p&gt;Łukasz, a CPython core developer and active member of the Python community, may be familiar to &lt;em&gt;Real Python&lt;/em&gt; readers. In Episode 7 of the &lt;a href=&quot;https://realpython.com/podcasts/rpp/7/&quot;&gt;Real Python Podcast&lt;/a&gt;, Łukasz joined host &lt;a href=&quot;https://realpython.com/team/cbailey/&quot;&gt;Chris Bailey&lt;/a&gt; to talk about the origins of the &lt;a href=&quot;https://black.readthedocs.io/en/stable/&quot;&gt;Black&lt;/a&gt; code formatter, his experience as the Python release manager for Python 3.8 and 3.9, and how he melds Python with &lt;a href=&quot;https://www.youtube.com/watch?v=02CLD-42VdI&quot;&gt;his interest in music&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;As the first CPython Developer-in-Residence, Łukasz is responsible for:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Addressing pull requests and issue backlog&lt;/li&gt;
&lt;li&gt;Performing analytical research to understand volunteer hours and funding for CPython&lt;/li&gt;
&lt;li&gt;Investigating project priorities and their tasks going forward&lt;/li&gt;
&lt;li&gt;Working on project priorities&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In Łukasz’s statement about his new role, he describes his reaction to the announcement that the PSF was hiring:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;When the PSF first announced the Developer in Residence position, I was immediately incredibly hopeful for Python. I think it’s a role with transformational potential for the project. In short, I believe the mission of the Developer in Residence (DIR) is to accelerate the developer experience of everybody else. This includes not only the core development team, but most importantly the drive-by contributors submitting pull requests and creating issues on the tracker. (&lt;a href=&quot;https://lukasz.langa.pl/a072a74b-19d7-41ff-a294-e6b1319fdb6e/&quot;&gt;Source&lt;/a&gt;)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Łukasz maintains a log of his work each week in a &lt;a href=&quot;https://lukasz.langa.pl/python/developer-in-residence/&quot;&gt;series of weekly reports&lt;/a&gt; on his personal website. During his first week on the job, he closed fourteen issues and fifty-four pull requests (PRs), reviewed nine PRs, and authored six of his own PRs.&lt;/p&gt;
&lt;p&gt;“Don’t get too excited though about those numbers,” Łukasz writes in his &lt;a href=&quot;https://lukasz.langa.pl/1c78554f-f81d-43d0-9c89-a602cafc4c5a/&quot;&gt;first weekly report&lt;/a&gt;. “The way CPython is developed, many changes start on the &lt;code&gt;main&lt;/code&gt; branch, and then get back ported to [Python] 3.10 and often also to 3.9. So some changes are tripled in those stats.”&lt;/p&gt;
&lt;p&gt;The transparency that the weekly reports offer is refreshing and provides a unique look behind the scenes of the role. Future applicants will have a fantastic resource to help them understand what the job entails, what is working well, and where improvements can be made.&lt;/p&gt;
&lt;p&gt;Łukasz wrote two weekly reports in July:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-news-july-2021/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-news-july-2021/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #73: Supporting Python Open Source Projects and Maintainers</title>
      <id>https://realpython.com/podcasts/rpp/73/</id>
      <link href="https://realpython.com/podcasts/rpp/73/"/>
      <updated>2021-08-13T12:00:00+00:00</updated>
      <summary>How do you define open source software? What are the challenges an open source project and maintainers face? How do maintainers receive financial, legal, security, or other types of help? This week on the show, we have Josh Simmons from Tidelift and the Open Source Initiative to help answer these questions.</summary>
      <content type="html">
        &lt;p&gt;How do you define open source software? What are the challenges an open source project and maintainers face? How do maintainers receive financial, legal, security, or other types of help? This week on the show, we have Josh Simmons from Tidelift and the Open Source Initiative to help answer these questions.&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 the Python return Statement Effectively</title>
      <id>https://realpython.com/courses/effective-python-return-statement/</id>
      <link href="https://realpython.com/courses/effective-python-return-statement/"/>
      <updated>2021-08-10T14:00:00+00:00</updated>
      <summary>In this step-by-step course, you&#x27;ll learn how to use the Python return statement when writing functions. Additionally, you&#x27;ll cover some good programming practices related to the use of return. With this knowledge, you&#x27;ll be able to write readable, robust, and maintainable functions in Python.</summary>
      <content type="html">
        &lt;p&gt;The Python &lt;a href=&quot;https://en.wikipedia.org/wiki/Return_statement&quot;&gt;&lt;code&gt;return&lt;/code&gt; statement&lt;/a&gt; is a key component of &lt;a href=&quot;https://realpython.com/defining-your-own-python-function/&quot;&gt;functions&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/python3-object-oriented-programming/#instance-methods&quot;&gt;methods&lt;/a&gt;. You can use the &lt;code&gt;return&lt;/code&gt; statement to make your functions send Python objects back to the caller code. These objects are known as the function&amp;rsquo;s &lt;strong&gt;return value&lt;/strong&gt;. You can use them to perform further computation in your programs.&lt;/p&gt;
&lt;p&gt;Using the &lt;code&gt;return&lt;/code&gt; statement effectively is a core skill if you want to code custom functions that are &lt;a href=&quot;https://realpython.com/learning-paths/writing-pythonic-code/&quot;&gt;Pythonic&lt;/a&gt; and robust.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How to use the &lt;strong&gt;Python &lt;code&gt;return&lt;/code&gt; statement&lt;/strong&gt; in your functions&lt;/li&gt;
&lt;li&gt;How to return &lt;strong&gt;single&lt;/strong&gt; or &lt;strong&gt;multiple values&lt;/strong&gt; from your functions&lt;/li&gt;
&lt;li&gt;What &lt;strong&gt;best practices&lt;/strong&gt; to observe when using &lt;code&gt;return&lt;/code&gt; statements&lt;/li&gt;
&lt;li&gt;How to structure more &lt;strong&gt;advanced&lt;/strong&gt; return statements&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Walrus Operator: Python 3.8 Assignment Expressions</title>
      <id>https://realpython.com/python-walrus-operator/</id>
      <link href="https://realpython.com/python-walrus-operator/"/>
      <updated>2021-08-09T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn about assignment expressions and the walrus operator. The biggest change in Python 3.8 was the inclusion of the := operator, which you can use to assign variables in the middle of expressions. You&#x27;ll see several examples of how to take advantage of this new feature.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Each new version of Python adds new features to the language. For Python 3.8, the biggest change is the addition of &lt;strong&gt;assignment expressions&lt;/strong&gt;. Specifically, the &lt;code&gt;:=&lt;/code&gt; operator gives you a new syntax for assigning variables in the middle of expressions. This operator is colloquially known as the &lt;strong&gt;walrus operator&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;This tutorial is an in-depth introduction to the walrus operator. You will learn some of the motivations for the syntax update and explore some examples where assignment expressions can be useful.&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;Identify &lt;strong&gt;the walrus operator&lt;/strong&gt; and understand its meaning&lt;/li&gt;
&lt;li&gt;Understand &lt;strong&gt;use cases&lt;/strong&gt; for the walrus operator&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Avoid repetitive code&lt;/strong&gt; by using the walrus operator&lt;/li&gt;
&lt;li&gt;Convert between code using the walrus operator and code using &lt;strong&gt;other assignment methods&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Understand the impacts on &lt;strong&gt;backward compatibility&lt;/strong&gt; when using the walrus operator&lt;/li&gt;
&lt;li&gt;Use appropriate &lt;strong&gt;style&lt;/strong&gt; in your assignment expressions&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Note that all walrus operator examples in this tutorial require &lt;a href=&quot;https://realpython.com/python38-new-features/&quot;&gt;Python 3.8&lt;/a&gt; or later to work.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&gt;Free Download:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-tricks-sample-pdf/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-tricks-sample-pdf&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Get a sample chapter from Python Tricks: The Book&lt;/a&gt; that shows you Python’s best practices with simple examples you can apply instantly to write more beautiful + Pythonic code.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;walrus-operator-fundamentals&quot;&gt;Walrus Operator Fundamentals&lt;a class=&quot;headerlink&quot; href=&quot;#walrus-operator-fundamentals&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Let’s start with some different terms that programmers use to refer to this new syntax. You’ve already seen a few in this tutorial. &lt;/p&gt;
&lt;p&gt;The &lt;code&gt;:=&lt;/code&gt; operator is officially known as the &lt;strong&gt;assignment expression operator&lt;/strong&gt;. During early discussions, it was dubbed the &lt;strong&gt;walrus operator&lt;/strong&gt; because the &lt;code&gt;:=&lt;/code&gt; syntax resembles the eyes and tusks of a sideways &lt;a href=&quot;https://en.wikipedia.org/wiki/Walrus&quot;&gt;walrus&lt;/a&gt;. You may also see the &lt;code&gt;:=&lt;/code&gt; operator referred to as the &lt;strong&gt;colon equals operator&lt;/strong&gt;. Yet another term used for assignment expressions is &lt;strong&gt;named expressions&lt;/strong&gt;.&lt;/p&gt;
&lt;h3 id=&quot;hello-walrus&quot;&gt;Hello, Walrus!&lt;a class=&quot;headerlink&quot; href=&quot;#hello-walrus&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;To get a first impression of what assignment expressions are all about, start your REPL and play around with the following code:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;span class=&quot;repl-toggle&quot; title=&quot;Toggle REPL prompts and output&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;linenos&quot;&gt; 1&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;walrus&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;False&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 2&lt;/span&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;walrus&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 3&lt;/span&gt;&lt;span class=&quot;go&quot;&gt;False&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 4&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 5&lt;/span&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;walrus&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 6&lt;/span&gt;&lt;span class=&quot;go&quot;&gt;True&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 7&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;walrus&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 8&lt;/span&gt;&lt;span class=&quot;go&quot;&gt;True&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Line 1 shows a traditional &lt;a href=&quot;https://docs.python.org/3/reference/simple_stmts.html#assignment-statements&quot;&gt;assignment statement&lt;/a&gt; where the value &lt;code&gt;False&lt;/code&gt; is assigned to &lt;code&gt;walrus&lt;/code&gt;. Next, on line 5, you use an assignment expression to assign the value &lt;code&gt;True&lt;/code&gt; to &lt;code&gt;walrus&lt;/code&gt;. After both lines 1 and 5, you can refer to the assigned values by using the variable name &lt;code&gt;walrus&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;You might be wondering why you’re using parentheses on line 5, and you’ll learn why the parentheses are needed &lt;a href=&quot;#walrus-operator-syntax&quot;&gt;later on in this tutorial&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; A &lt;strong&gt;statement&lt;/strong&gt; in Python is a unit of code. An &lt;strong&gt;expression&lt;/strong&gt; is a special statement that can be evaluated to some value.&lt;/p&gt;
&lt;p&gt;For example, &lt;code&gt;1 + 2&lt;/code&gt; is an expression that evaluates to the value &lt;code&gt;3&lt;/code&gt;, while &lt;code&gt;number = 1 + 2&lt;/code&gt; is an assignment statement that doesn’t evaluate to a value. Although running the statement &lt;code&gt;number = 1 + 2&lt;/code&gt; doesn’t evaluate to &lt;code&gt;3&lt;/code&gt;, it does &lt;em&gt;assign&lt;/em&gt; the value &lt;code&gt;3&lt;/code&gt; to &lt;code&gt;number&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;In Python, you often see &lt;a href=&quot;https://docs.python.org/3/reference/simple_stmts.html&quot;&gt;simple statements&lt;/a&gt; like &lt;a href=&quot;https://realpython.com/python-return-statement/&quot;&gt;&lt;code&gt;return&lt;/code&gt; statements&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/python-import/&quot;&gt;&lt;code&gt;import&lt;/code&gt; statements&lt;/a&gt;, as well as &lt;a href=&quot;https://docs.python.org/3/reference/compound_stmts.html&quot;&gt;compound statements&lt;/a&gt; like &lt;a href=&quot;https://realpython.com/python-conditional-statements/&quot;&gt;&lt;code&gt;if&lt;/code&gt; statements&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/defining-your-own-python-function/&quot;&gt;function definitions&lt;/a&gt;. These are all statements, not expressions.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;There’s a subtle—but important—difference between the two types of assignments seen earlier with the &lt;code&gt;walrus&lt;/code&gt; variable. An assignment expression returns the value, while a traditional assignment doesn’t. You can see this in action when the REPL doesn’t print any value after &lt;code&gt;walrus = False&lt;/code&gt; on line 1, while it prints out &lt;code&gt;True&lt;/code&gt; after the assignment expression on line 5.&lt;/p&gt;
&lt;p&gt;You can see another important aspect about walrus operators in this example. Though it might look new, the &lt;code&gt;:=&lt;/code&gt; operator does &lt;em&gt;not&lt;/em&gt; do anything that isn’t possible without it. It only makes certain constructs more convenient and can sometimes communicate the intent of your code more clearly.&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 need at least &lt;a href=&quot;https://realpython.com/python38-new-features/&quot;&gt;Python 3.8&lt;/a&gt; to try out the examples in this tutorial. If you don’t already have Python 3.8 installed and you have &lt;a href=&quot;https://docs.docker.com/install/&quot;&gt;Docker&lt;/a&gt; available, a quick way to start working with Python 3.8 is to run one of &lt;a href=&quot;https://hub.docker.com/_/python/&quot;&gt;the official Docker images&lt;/a&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight sh&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;docker container run -it --rm python:3.8-slim
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This will download and run the latest stable version of Python 3.8. For more information, see &lt;a href=&quot;https://realpython.com/python-versions-docker/&quot;&gt;Run Python Versions in Docker: How to Try the Latest Python Release&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Now you have a basic idea of what the &lt;code&gt;:=&lt;/code&gt; operator is and what it can do. It’s an operator used in assignment expressions, which can return the value being assigned, unlike traditional assignment statements. To get deeper and really learn about the walrus operator, continue reading to see where you should and shouldn’t use it.&lt;/p&gt;
&lt;h3 id=&quot;implementation&quot;&gt;Implementation&lt;a class=&quot;headerlink&quot; href=&quot;#implementation&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Like most new features in Python, assignment expressions were introduced through a &lt;strong&gt;Python Enhancement Proposal&lt;/strong&gt; (PEP). &lt;a href=&quot;https://www.python.org/dev/peps/pep-0572&quot;&gt;PEP 572&lt;/a&gt; describes the motivation for introducing the walrus operator, the details of the syntax, as well as examples where the &lt;code&gt;:=&lt;/code&gt; operator can be used to improve your code.&lt;/p&gt;
&lt;p&gt;This PEP was &lt;a href=&quot;https://mail.python.org/archives/list/python-ideas@python.org/message/H64ZNZ3T4RRJKMXR6UFNX3FK62IRPVOT/&quot;&gt;originally&lt;/a&gt; written by &lt;a href=&quot;https://twitter.com/Rosuav&quot;&gt;Chris Angelico&lt;/a&gt; in February 2018. Following some heated discussion, PEP 572 was &lt;a href=&quot;https://mail.python.org/archives/list/python-dev@python.org/message/J6EBK6ZEHZXTVWYSUO5N5XCUS45UQSB3/&quot;&gt;accepted&lt;/a&gt; by &lt;a href=&quot;https://twitter.com/gvanrossum&quot;&gt;Guido van Rossum&lt;/a&gt; in July 2018. Since then, Guido &lt;a href=&quot;https://mail.python.org/archives/list/python-committers@python.org/message/GQONAGWBBFRHVRUPU7RNBM75MHKGUFJN/&quot;&gt;announced&lt;/a&gt; that he was stepping down from his role as &lt;a href=&quot;https://en.wikipedia.org/wiki/Benevolent_dictator_for_life&quot;&gt;benevolent dictator for life (BDFL)&lt;/a&gt;. Starting in early 2019, Python has been &lt;a href=&quot;https://www.python.org/dev/peps/pep-0013/&quot;&gt;governed&lt;/a&gt; by an elected &lt;a href=&quot;https://realpython.com/python38-new-features/#the-python-steering-council&quot;&gt;steering council&lt;/a&gt; instead.&lt;/p&gt;
&lt;p&gt;The walrus operator was implemented by &lt;a href=&quot;https://realpython.com/interview-emily-morehouse/&quot;&gt;Emily Morehouse&lt;/a&gt;, and made available in the first &lt;a href=&quot;https://www.python.org/downloads/release/python-380a1/&quot;&gt;alpha release&lt;/a&gt; of Python 3.8.&lt;/p&gt;
&lt;h3 id=&quot;motivation&quot;&gt;Motivation&lt;a class=&quot;headerlink&quot; href=&quot;#motivation&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;In many languages, including C and its derivatives, assignment statements function as expressions. This can be both very powerful and also a source of confusing bugs. For example, the following code is valid C but doesn’t execute as intended:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-walrus-operator/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-walrus-operator/ »&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 #72: Starting With FastAPI and Examining Python&#x27;s Import System</title>
      <id>https://realpython.com/podcasts/rpp/72/</id>
      <link href="https://realpython.com/podcasts/rpp/72/"/>
      <updated>2021-08-06T12:00:00+00:00</updated>
      <summary>Have you heard of FastAPI?  An application programming interface is vital to make your software accessible to users across the internet. FastAPI is an excellent option for quickly creating a web API that implements best practices. This week on the show, David Amos is back, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;Have you heard of FastAPI?  An application programming interface is vital to make your software accessible to users across the internet. FastAPI is an excellent option for quickly creating a web API that implements best practices. This week on the show, David Amos is back, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Using sleep() to Code a Python Uptime Bot</title>
      <id>https://realpython.com/courses/python-sleep-uptime-bot/</id>
      <link href="https://realpython.com/courses/python-sleep-uptime-bot/"/>
      <updated>2021-08-03T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll learn how to add time delays to your Python programs. You&#x27;ll use the built-in time module to add Python sleep() calls to your code. To practice, you&#x27;ll use time.sleep() when making an uptime bot that checks whether a website is still live.</summary>
      <content type="html">
        &lt;p&gt;Have you ever needed to make your Python program wait for something? You might use a Python &lt;code&gt;sleep()&lt;/code&gt; call to simulate a delay in your program. Perhaps you need to wait for a file to upload or download, or for a graphic to load or be drawn to the screen. You might even need to pause between calls to a web &lt;a href=&quot;https://realpython.com/python-api/&quot;&gt;API&lt;/a&gt;, or between queries to a database. Adding Python &lt;strong&gt;&lt;code&gt;sleep()&lt;/code&gt;&lt;/strong&gt; calls to your program can help in each of these cases, and many more!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The basics of &lt;strong&gt;&lt;code&gt;time.sleep()&lt;/code&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How you can use &lt;code&gt;timeit&lt;/code&gt; to &lt;strong&gt;measure&lt;/strong&gt; your code&amp;rsquo;s &lt;strong&gt;execution time&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to use &lt;code&gt;time.sleep()&lt;/code&gt; to build an &lt;strong&gt;uptime bot&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Python&#x27;s ChainMap: Manage Multiple Contexts Effectively</title>
      <id>https://realpython.com/python-chainmap/</id>
      <link href="https://realpython.com/python-chainmap/"/>
      <updated>2021-08-02T14:00:00+00:00</updated>
      <summary>In this step-by-step tutorial, you&#x27;ll learn about Python&#x27;s ChainMap and how to use it to group multiple dictionaries together and manage them as a single one. ChainMap is handy when you need to manage multiple scopes and contexts and define access priorities.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Sometimes when you’re working with several different dictionaries, you need to group and manage them as a single one. In other situations, you can have multiple dictionaries representing different &lt;strong&gt;scopes&lt;/strong&gt; or &lt;strong&gt;contexts&lt;/strong&gt; and need to handle them as a single dictionary that allows you to access the underlying data following a given order or priority. In those cases, you can take advantage of Python’s &lt;a href=&quot;https://docs.python.org/3/library/collections.html?highlight=collections#collections.ChainMap&quot;&gt;&lt;code&gt;ChainMap&lt;/code&gt;&lt;/a&gt; from the &lt;a href=&quot;https://docs.python.org/3/library/collections.html#module-collections&quot;&gt;&lt;code&gt;collections&lt;/code&gt; module&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;ChainMap&lt;/code&gt; groups multiple dictionaries and mappings in a single, updatable view with dictionary-like behavior. Additionally, &lt;code&gt;ChainMap&lt;/code&gt; provides features that allow you to efficiently manage various dictionaries, define key lookup priorities, and more.&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 &lt;strong&gt;&lt;code&gt;ChainMap&lt;/code&gt; instances&lt;/strong&gt; in your Python programs&lt;/li&gt;
&lt;li&gt;Explore the &lt;strong&gt;differences&lt;/strong&gt; between &lt;code&gt;ChainMap&lt;/code&gt; and &lt;code&gt;dict&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;ChainMap&lt;/code&gt; to work with &lt;strong&gt;several dictionaries as one&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Manage &lt;strong&gt;key lookup priorities&lt;/strong&gt; with &lt;code&gt;ChainMap&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To get the most out of this tutorial, you should know the basics of working with &lt;a href=&quot;https://realpython.com/python-dicts/&quot;&gt;dictionaries&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/python-lists-tuples/&quot;&gt;lists&lt;/a&gt; in Python.&lt;/p&gt;
&lt;p&gt;By the end of the journey, you’ll find a few practical examples that will help you better understand the most relevant features and use cases of &lt;code&gt;ChainMap&lt;/code&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/python-mastery-course/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-mastery-course&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;5 Thoughts On Python Mastery&lt;/a&gt;, a free course for Python developers that shows you the roadmap and the mindset you’ll need to take your Python skills to the next level.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;getting-started-with-pythons-chainmap&quot;&gt;Getting Started With Python’s &lt;code&gt;ChainMap&lt;/code&gt;&lt;a class=&quot;headerlink&quot; href=&quot;#getting-started-with-pythons-chainmap&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Python’s &lt;a href=&quot;https://docs.python.org/3/library/collections.html#collections.ChainMap&quot;&gt;&lt;code&gt;ChainMap&lt;/code&gt;&lt;/a&gt; was added to &lt;code&gt;collections&lt;/code&gt; in &lt;a href=&quot;https://docs.python.org/3/whatsnew/3.3.html#collections&quot;&gt;Python 3.3&lt;/a&gt; as a handy tool for managing multiple &lt;strong&gt;scopes&lt;/strong&gt; and &lt;strong&gt;contexts&lt;/strong&gt;. This class allows you to group several dictionaries and other &lt;a href=&quot;https://docs.python.org/3/glossary.html#term-mapping&quot;&gt;mappings&lt;/a&gt; together to make them logically appear and behave as one. It creates a single &lt;strong&gt;updatable view&lt;/strong&gt; that works similar to a regular dictionary but with some internal differences.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;ChainMap&lt;/code&gt; doesn’t merge its mappings together. Instead, it keeps them in an internal list of mappings. Then &lt;code&gt;ChainMap&lt;/code&gt; reimplements common dictionary operations on top of that list. Since the internal list holds references to the original input mapping, any changes in those mappings affect the &lt;code&gt;ChainMap&lt;/code&gt; object as a whole.&lt;/p&gt;
&lt;p&gt;Storing the input mappings in a list allows you to have duplicate keys in a given chain map. If you perform a &lt;strong&gt;key lookup&lt;/strong&gt;, then &lt;code&gt;ChainMap&lt;/code&gt; searches the list of mappings until it finds the first occurrence of the target key. If the key is missing, then you get a &lt;a href=&quot;https://realpython.com/python-keyerror/&quot;&gt;&lt;code&gt;KeyError&lt;/code&gt;&lt;/a&gt; as usual.&lt;/p&gt;
&lt;p&gt;Storing the mappings in a list truly shines when you need to manage nested &lt;a href=&quot;https://realpython.com/python-namespaces-scope/&quot;&gt;scopes&lt;/a&gt;, where each mapping represents a specific scope or context.&lt;/p&gt;
&lt;p&gt;To better understand what scopes and contexts are about, think about how Python resolves names. When Python looks for a name, it searches in &lt;a href=&quot;https://realpython.com/python-scope-legb-rule/#locals&quot;&gt;&lt;code&gt;locals()&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-scope-legb-rule/#globals&quot;&gt;&lt;code&gt;globals()&lt;/code&gt;&lt;/a&gt;, and finally &lt;a href=&quot;https://realpython.com/python-scope-legb-rule/#builtins-the-built-in-scope&quot;&gt;&lt;code&gt;builtins&lt;/code&gt;&lt;/a&gt; until it finds the first occurrence of the target name. If the name doesn’t exist, then you get a &lt;code&gt;NameError&lt;/code&gt;. Dealing with scopes and contexts is the most common kind of problem you can solve with &lt;code&gt;ChainMap&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;When you’re working with &lt;code&gt;ChainMap&lt;/code&gt;, you can chain several dictionaries with keys that are either &lt;a href=&quot;https://en.wikipedia.org/wiki/Disjoint_sets&quot;&gt;disjoint&lt;/a&gt; or &lt;a href=&quot;https://en.wikipedia.org/wiki/Intersection_(set_theory)&quot;&gt;intersecting&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In the first case, &lt;code&gt;ChainMap&lt;/code&gt; allows you to treat all your dictionaries as one. So, you can access the key-value pairs as if you were working with a single dictionary. In the second case, besides managing your dictionaries as one, you can also take advantage of the internal list of mappings to define some sort of &lt;strong&gt;access priority&lt;/strong&gt; for repeated keys across your dictionaries. That’s why &lt;code&gt;ChainMap&lt;/code&gt; objects are great for handling multiple contexts.&lt;/p&gt;
&lt;p&gt;A curious behavior of &lt;code&gt;ChainMap&lt;/code&gt; is that &lt;strong&gt;mutations&lt;/strong&gt;, such as updating, adding, deleting, clearing, and popping keys, act only on the first mapping in the internal list of mappings. Here’s a summary of the main features of &lt;code&gt;ChainMap&lt;/code&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Builds an &lt;strong&gt;updatable view&lt;/strong&gt; from several input mappings&lt;/li&gt;
&lt;li&gt;Provides almost the &lt;strong&gt;same interface as a dictionary&lt;/strong&gt;, but with some extra features&lt;/li&gt;
&lt;li&gt;Doesn’t merge the input mappings but instead keeps them in an &lt;strong&gt;internal public list&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Sees &lt;strong&gt;external changes&lt;/strong&gt; in the input mappings&lt;/li&gt;
&lt;li&gt;Can contain &lt;strong&gt;repeated keys&lt;/strong&gt; with different values&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Searches keys sequentially&lt;/strong&gt; through the internal list of mappings&lt;/li&gt;
&lt;li&gt;Throws a &lt;strong&gt;&lt;code&gt;KeyError&lt;/code&gt; when a key is missing&lt;/strong&gt; after searching the entire list of mappings&lt;/li&gt;
&lt;li&gt;Performs &lt;strong&gt;mutations only on the first mapping&lt;/strong&gt; in the internal list&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In this tutorial, you’ll learn a lot more about all these cool features of &lt;code&gt;ChainMap&lt;/code&gt;. The following section will guide you through how to create new instances of &lt;code&gt;ChainMap&lt;/code&gt; in your code.&lt;/p&gt;
&lt;h3 id=&quot;instantiating-chainmap&quot;&gt;Instantiating &lt;code&gt;ChainMap&lt;/code&gt;&lt;a class=&quot;headerlink&quot; href=&quot;#instantiating-chainmap&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;To create &lt;code&gt;ChainMap&lt;/code&gt; in your Python code, you first need to import the class from &lt;code&gt;collections&lt;/code&gt; and then call it as usual. The class initializer can take zero or more mappings as arguments. With no arguments, it initializes a chain map with an empty dictionary inside:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;span class=&quot;repl-toggle&quot; title=&quot;Toggle REPL prompts and output&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;collections&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ChainMap&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;collections&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;OrderedDict&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;defaultdict&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;# Use no arguments&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;ChainMap&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;ChainMap({})&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;# Use regular dictionaries&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;numbers&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;s2&quot;&gt;&quot;one&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;two&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;letters&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;s2&quot;&gt;&quot;a&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;A&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;b&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;B&quot;&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;ChainMap&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;numbers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;letters&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;ChainMap({&#x27;one&#x27;: 1, &#x27;two&#x27;: 2}, {&#x27;a&#x27;: &#x27;A&#x27;, &#x27;b&#x27;: &#x27;B&#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;ChainMap&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;numbers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;a&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;A&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;b&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;B&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;ChainMap({&#x27;one&#x27;: 1, &#x27;two&#x27;: 2}, {&#x27;a&#x27;: &#x27;A&#x27;, &#x27;b&#x27;: &#x27;B&#x27;})&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;# Use other mappings&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;numbers&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;OrderedDict&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;one&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;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;two&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;letters&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;defaultdict&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;a&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;A&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;b&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;B&quot;&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;ChainMap&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;numbers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;letters&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;ChainMap(&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;    OrderedDict([(&#x27;one&#x27;, 1), (&#x27;two&#x27;, 2)]),&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;    defaultdict(&amp;lt;class &#x27;str&#x27;&amp;gt;, {&#x27;a&#x27;: &#x27;A&#x27;, &#x27;b&#x27;: &#x27;B&#x27;})&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Here, you create several &lt;code&gt;ChainMap&lt;/code&gt; objects using different combinations of mappings. In each case, &lt;code&gt;ChainMap&lt;/code&gt; returns a single dictionary-like view of all the input mappings. Note that you can use any type of mapping, such as &lt;a href=&quot;https://realpython.com/python-ordereddict/&quot;&gt;&lt;code&gt;OrderedDict&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/python-defaultdict/&quot;&gt;&lt;code&gt;defaultdict&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You can also create &lt;code&gt;ChainMap&lt;/code&gt; objects using the &lt;a href=&quot;https://realpython.com/instance-class-and-static-methods-demystified/&quot;&gt;class method&lt;/a&gt; &lt;code&gt;.fromkeys()&lt;/code&gt;. This method can take an iterable of keys and an optional default value for all the keys:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;span class=&quot;repl-toggle&quot; title=&quot;Toggle REPL prompts and output&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;collections&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ChainMap&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;ChainMap&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;fromkeys&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;one&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;two&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;three&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;ChainMap({&#x27;one&#x27;: None, &#x27;two&#x27;: None, &#x27;three&#x27;: None})&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;ChainMap&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;fromkeys&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;one&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;two&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;three&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;ChainMap({&#x27;one&#x27;: 0, &#x27;two&#x27;: 0, &#x27;three&#x27;: 0})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If you call &lt;code&gt;.fromkeys()&lt;/code&gt; on &lt;code&gt;ChainMap&lt;/code&gt; with an iterable of keys as an argument, then you get a chain map with a single dictionary. The keys come from the input iterable, and the values default to &lt;a href=&quot;https://realpython.com/null-in-python/&quot;&gt;&lt;code&gt;None&lt;/code&gt;&lt;/a&gt;. Optionally, you can pass a second argument to &lt;code&gt;.fromkeys()&lt;/code&gt; to provide a sensible default value for every key.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-chainmap/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-chainmap/ »&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 #71: Start Using a Debugger With Your Python Code</title>
      <id>https://realpython.com/podcasts/rpp/71/</id>
      <link href="https://realpython.com/podcasts/rpp/71/"/>
      <updated>2021-07-30T12:00:00+00:00</updated>
      <summary>Are you still sprinkling print statements throughout your code while writing it? Print statements are often clunky and offer only a limited view of the state of your code. Have you thought there must be a better way? This week on the show, we have Nina Zakharenko to discuss her conference talk titled &quot;Goodbye Print, Hello Debugger.&quot;</summary>
      <content type="html">
        &lt;p&gt;Are you still sprinkling print statements throughout your code while writing it? Print statements are often clunky and offer only a limited view of the state of your code. Have you thought there must be a better way? This week on the show, we have Nina Zakharenko to discuss her conference talk titled &quot;Goodbye Print, Hello Debugger.&quot;&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 and REST APIs: Interacting With Web Services</title>
      <id>https://realpython.com/api-integration-in-python/</id>
      <link href="https://realpython.com/api-integration-in-python/"/>
      <updated>2021-07-28T14:01:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn how to use Python to communicate with REST APIs. You&#x27;ll learn about REST architecture and how to use the requests library to get data from a REST API. You&#x27;ll also explore different Python tools you can use to build REST APIs.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;There’s an amazing amount of data available on the Web. Many &lt;strong&gt;web services&lt;/strong&gt;, like YouTube and GitHub, make their data accessible to third-party applications through an &lt;strong&gt;application programming interface (API)&lt;/strong&gt;. One of the most popular ways to build APIs is the &lt;strong&gt;REST&lt;/strong&gt; architecture style. Python provides some great tools not only to get data from REST APIs but also to build your own Python REST APIs.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What &lt;strong&gt;REST&lt;/strong&gt; architecture is&lt;/li&gt;
&lt;li&gt;How &lt;strong&gt;REST APIs&lt;/strong&gt; provide access to web data&lt;/li&gt;
&lt;li&gt;How to consume data from REST APIs using the &lt;strong&gt;&lt;code&gt;requests&lt;/code&gt;&lt;/strong&gt; library&lt;/li&gt;
&lt;li&gt;What steps to take to &lt;strong&gt;build a REST API&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;What some popular &lt;strong&gt;Python tools&lt;/strong&gt; are for building REST APIs&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;By using Python and REST APIs, you can retrieve, parse, update, and manipulate the data provided by any web service you’re interested in.&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-rest-api-guide-exampes&quot; data-focus=&quot;false&quot;&gt;Click here to download a copy of the &quot;REST API Examples&quot; Guide&lt;/a&gt; and get a hands-on introduction to Python + REST API principles with actionable examples.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;rest-architecture&quot;&gt;REST Architecture&lt;a class=&quot;headerlink&quot; href=&quot;#rest-architecture&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;REST&lt;/strong&gt; stands for &lt;a href=&quot;https://en.wikipedia.org/wiki/Representational_state_transfer&quot;&gt;&lt;strong&gt;re&lt;/strong&gt;presentational &lt;strong&gt;s&lt;/strong&gt;tate &lt;strong&gt;t&lt;/strong&gt;ransfer&lt;/a&gt; and is a software architecture style that defines a pattern for &lt;a href=&quot;https://en.wikipedia.org/wiki/Client%E2%80%93server_model&quot;&gt;client and server&lt;/a&gt; communications over a network. REST provides a set of constraints for software architecture to promote performance, scalability, simplicity, and reliability in the system.&lt;/p&gt;
&lt;p&gt;REST defines the following architectural constraints:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Stateless:&lt;/strong&gt; The server won’t maintain any state between requests from the client.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Client-server:&lt;/strong&gt; The client and server must be decoupled from each other, allowing each to develop independently.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cacheable:&lt;/strong&gt; The data retrieved from the server should be cacheable either by the client or by the server. &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Uniform interface:&lt;/strong&gt; The server will provide a uniform interface for accessing resources without defining their representation.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Layered system:&lt;/strong&gt; The client may access the resources on the server indirectly through other layers such as a &lt;a href=&quot;https://en.wikipedia.org/wiki/Proxy_server&quot;&gt;proxy&lt;/a&gt; or &lt;a href=&quot;https://en.wikipedia.org/wiki/Load_balancing_(computing)&quot;&gt;load balancer&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Code on demand (optional):&lt;/strong&gt; The server may transfer code to the client that it can run, such as &lt;a href=&quot;https://realpython.com/python-vs-javascript/&quot;&gt;JavaScript&lt;/a&gt; for a single-page application.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Note, REST is &lt;em&gt;not&lt;/em&gt; a specification but a set of guidelines on how to architect a network-connected software system.&lt;/p&gt;
&lt;h2 id=&quot;rest-apis-and-web-services&quot;&gt;REST APIs and Web Services&lt;a class=&quot;headerlink&quot; href=&quot;#rest-apis-and-web-services&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A &lt;strong&gt;REST web service&lt;/strong&gt; is any web service that adheres to REST architecture constraints. These web services expose their data to the outside world through an API. REST APIs provide access to web service data through public web URLs.&lt;/p&gt;
&lt;p&gt;For example, here’s one of the URLs for &lt;a href=&quot;https://docs.github.com/en/free-pro-team@latest/rest&quot;&gt;GitHub’s REST API&lt;/a&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;https://api.github.com/users/&amp;lt;username&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This URL allows you to access information about a specific GitHub user. You access data from a REST API by sending an &lt;a href=&quot;https://realpython.com/python-https/#what-is-http&quot;&gt;HTTP request&lt;/a&gt; to a specific URL and processing the response.&lt;/p&gt;
&lt;h3 id=&quot;http-methods&quot;&gt;HTTP Methods&lt;a class=&quot;headerlink&quot; href=&quot;#http-methods&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;REST APIs listen for &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods&quot;&gt;HTTP methods&lt;/a&gt; like &lt;code&gt;GET&lt;/code&gt;, &lt;code&gt;POST&lt;/code&gt;, and &lt;code&gt;DELETE&lt;/code&gt; to know which operations to perform on the web service’s resources. A &lt;strong&gt;resource&lt;/strong&gt; is any data available in the web service that can be accessed and manipulated with &lt;strong&gt;HTTP requests&lt;/strong&gt; to the REST API. The HTTP method tells the API which action to perform on the resource.&lt;/p&gt;
&lt;p&gt;While there are many HTTP methods, the five methods listed below are the most commonly used with REST APIs:&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;HTTP method&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GET&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Retrieve an existing resource.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;POST&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Create a new resource.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;PUT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Update an existing resource.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;PATCH&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Partially update an existing resource.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DELETE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Delete a resource.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;A REST API client application can use these five HTTP methods to manage the state of resources in the web service.&lt;/p&gt;
&lt;h3 id=&quot;status-codes&quot;&gt;Status Codes&lt;a class=&quot;headerlink&quot; href=&quot;#status-codes&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Once a REST API receives and processes an HTTP request, it will return an &lt;strong&gt;HTTP response&lt;/strong&gt;. Included in this response is an &lt;strong&gt;HTTP status code&lt;/strong&gt;. This code provides information about the results of the request. An application sending requests to the API can check the status code and perform actions based on the result. These actions could include handling errors or displaying a success message to a user.&lt;/p&gt;
&lt;p&gt;Below is a list of the most common status codes returned by REST APIs:&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;Code&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;200&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;OK&lt;/td&gt;
&lt;td&gt;The requested action was successful.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;201&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Created&lt;/td&gt;
&lt;td&gt;A new resource was created.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;202&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Accepted&lt;/td&gt;
&lt;td&gt;The request was received, but no modification has been made yet.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;204&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;No Content&lt;/td&gt;
&lt;td&gt;The request was successful, but the response has no content.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;400&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Bad Request&lt;/td&gt;
&lt;td&gt;The request was malformed.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;401&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Unauthorized&lt;/td&gt;
&lt;td&gt;The client is not authorized to perform the requested action.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;404&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Not Found&lt;/td&gt;
&lt;td&gt;The requested resource was not found.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;415&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Unsupported Media Type&lt;/td&gt;
&lt;td&gt;The request data format is not supported by the server.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;422&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Unprocessable Entity&lt;/td&gt;
&lt;td&gt;The request data was properly formatted but contained invalid or missing data.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;500&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Internal Server Error&lt;/td&gt;
&lt;td&gt;The server threw an error when processing the request.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;These ten status codes represent only a small subset of the available &lt;a href=&quot;https://en.wikipedia.org/wiki/List_of_HTTP_status_codes&quot;&gt;HTTP status codes&lt;/a&gt;. Status codes are numbered based on the category of the result:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/api-integration-in-python/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/api-integration-in-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 Pandas DataFrame: Working With Data Efficiently</title>
      <id>https://realpython.com/courses/pandas-dataframe-working-with-data/</id>
      <link href="https://realpython.com/courses/pandas-dataframe-working-with-data/"/>
      <updated>2021-07-27T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll get started with Pandas DataFrames, which are powerful and widely used two-dimensional data structures. You&#x27;ll learn how to perform basic operations with data, handle missing values, work with time-series data, and visualize data from a Pandas DataFrame.</summary>
      <content type="html">
        &lt;p&gt;The &lt;a href=&quot;https://pandas.pydata.org/pandas-docs/stable/reference/frame.html&quot;&gt;Pandas DataFrame&lt;/a&gt; is a &lt;a href=&quot;https://pandas.pydata.org/pandas-docs/stable/user_guide/dsintro.html&quot;&gt;structure&lt;/a&gt; that contains &lt;strong&gt;two-dimensional data&lt;/strong&gt; and its corresponding &lt;strong&gt;labels&lt;/strong&gt;. DataFrames are widely used in &lt;a href=&quot;https://realpython.com/tutorials/data-science/&quot;&gt;data science&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/tutorials/machine-learning/&quot;&gt;machine learning&lt;/a&gt;, scientific computing, and many other data-intensive fields.&lt;/p&gt;
&lt;p&gt;DataFrames are similar to &lt;a href=&quot;https://realpython.com/python-sql-libraries/&quot;&gt;SQL tables&lt;/a&gt; or the spreadsheets that you work with in Excel or Calc. In many cases, DataFrames are faster, easier to use, and more powerful than tables or spreadsheets because they&amp;rsquo;re an integral part of the &lt;a href=&quot;https://www.python.org/about/&quot;&gt;Python&lt;/a&gt; and &lt;a href=&quot;https://numpy.org/#&quot;&gt;NumPy&lt;/a&gt; ecosystems.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What a &lt;strong&gt;Pandas DataFrame&lt;/strong&gt; is and how to create one&lt;/li&gt;
&lt;li&gt;How to &lt;strong&gt;access, modify, add, sort, filter, and delete&lt;/strong&gt; data&lt;/li&gt;
&lt;li&gt;How to handle &lt;strong&gt;missing values&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to work with &lt;strong&gt;time-series data&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to quickly &lt;strong&gt;visualize&lt;/strong&gt; data&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Python&#x27;s collections: A Buffet of Specialized Data Types</title>
      <id>https://realpython.com/python-collections-module/</id>
      <link href="https://realpython.com/python-collections-module/"/>
      <updated>2021-07-26T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn all about the series of specialized container data types in the collections module from the Python standard library.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Python’s &lt;a href=&quot;https://docs.python.org/3/library/collections.html#module-collections&quot;&gt;&lt;code&gt;collections&lt;/code&gt;&lt;/a&gt; module provides a rich set of &lt;strong&gt;specialized container data types&lt;/strong&gt; carefully designed to approach specific programming problems in a Pythonic and efficient way. The module also provides wrapper classes that make it safer to create custom classes that behave similar to the built-in types &lt;code&gt;dict&lt;/code&gt;, &lt;code&gt;list&lt;/code&gt;, and &lt;code&gt;str&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Learning about the data types and classes in &lt;code&gt;collections&lt;/code&gt; will allow you to grow your programming tool kit with a valuable set of reliable and efficient tools.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll learn how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Write &lt;strong&gt;readable&lt;/strong&gt; and &lt;strong&gt;explicit&lt;/strong&gt; code with &lt;code&gt;namedtuple&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Build &lt;strong&gt;efficient queues and stacks&lt;/strong&gt; with &lt;code&gt;deque&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Count&lt;/strong&gt; objects quickly with &lt;code&gt;Counter&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Handle &lt;strong&gt;missing dictionary keys&lt;/strong&gt; with &lt;code&gt;defaultdict&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Guarantee the &lt;strong&gt;insertion order&lt;/strong&gt; of keys with &lt;code&gt;OrderedDict&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Manage &lt;strong&gt;multiple dictionaries&lt;/strong&gt; as a single unit with &lt;code&gt;ChainMap&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To better understand the data types and classes in &lt;code&gt;collections&lt;/code&gt;, you should know the basics of working with Python’s built-in data types, such as &lt;a href=&quot;https://realpython.com/python-lists-tuples/&quot;&gt;lists, tuples&lt;/a&gt;, and &lt;a href=&quot;https://realpython.com/python-dicts/&quot;&gt;dictionaries&lt;/a&gt;. Additionally, the last part of the article requires some basic knowledge about &lt;a href=&quot;https://realpython.com/python3-object-oriented-programming/&quot;&gt;object-oriented programming&lt;/a&gt; in Python.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&gt;Free Download:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-tricks-sample-pdf/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-tricks-sample-pdf&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Get a sample chapter from Python Tricks: The Book&lt;/a&gt; that shows you Python’s best practices with simple examples you can apply instantly to write more beautiful + Pythonic code.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;getting-started-with-pythons-collections&quot;&gt;Getting Started With Python’s &lt;code&gt;collections&lt;/code&gt;&lt;a class=&quot;headerlink&quot; href=&quot;#getting-started-with-pythons-collections&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Back in &lt;a href=&quot;https://docs.python.org/3/whatsnew/2.4.html#new-improved-and-deprecated-modules&quot;&gt;Python 2.4&lt;/a&gt;, &lt;a href=&quot;https://twitter.com/raymondh&quot;&gt;Raymond Hettinger&lt;/a&gt; contributed a new module called &lt;a href=&quot;https://docs.python.org/3/library/collections.html#module-collections&quot;&gt;&lt;code&gt;collections&lt;/code&gt;&lt;/a&gt; to the &lt;a href=&quot;https://docs.python.org/3/library/index.html&quot;&gt;standard library&lt;/a&gt;. The goal was to provide various specialized collection data types to approach specific programming problems.&lt;/p&gt;
&lt;p&gt;At that time, &lt;code&gt;collections&lt;/code&gt; only included one data structure, &lt;strong&gt;&lt;code&gt;deque&lt;/code&gt;&lt;/strong&gt;, which was specially designed as a &lt;a href=&quot;https://en.wikipedia.org/wiki/Double-ended_queue&quot;&gt;double-ended queue&lt;/a&gt; that supports efficient &lt;strong&gt;append&lt;/strong&gt; and &lt;strong&gt;pop&lt;/strong&gt; operations on either end of the sequence. From this point on, several modules in the standard library took advantage of &lt;code&gt;deque&lt;/code&gt; to improve the performance of their classes and structures. Some outstanding examples are &lt;a href=&quot;https://docs.python.org/3/library/queue.html#module-queue&quot;&gt;&lt;code&gt;queue&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://docs.python.org/3/library/threading.html#module-threading&quot;&gt;&lt;code&gt;threading&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;With time, a handful of specialized container data types populated the module:&lt;/p&gt;
&lt;div class=&quot;table-responsive&quot;&gt;
&lt;table class=&quot;table table-hover&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Data type&lt;/th&gt;
&lt;th&gt;Python version&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://docs.python.org/3/library/collections.html#collections.deque&quot;&gt;&lt;code&gt;deque&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://docs.python.org/3/whatsnew/2.4.html#new-improved-and-deprecated-modules&quot;&gt;2.4&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;A sequence-like collection that supports efficient addition and removal of items from either end of the sequence&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://docs.python.org/3/library/collections.html#collections.defaultdict&quot;&gt;&lt;code&gt;defaultdict&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://docs.python.org/3/whatsnew/2.5.html#new-improved-and-removed-modules&quot;&gt;2.5&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;A dictionary subclass for constructing default values for missing keys and automatically adding them to the dictionary&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://docs.python.org/3/library/collections.html#collections.namedtuple&quot;&gt;&lt;code&gt;namedtuple()&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://docs.python.org/3/whatsnew/2.6.html#new-and-improved-modules&quot;&gt;2.6&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;A factory function for creating subclasses of &lt;code&gt;tuple&lt;/code&gt; that provides named fields that allow accessing items by name while keeping the ability to access items by index&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://docs.python.org/3/library/collections.html#collections.OrderedDict&quot;&gt;&lt;code&gt;OrderedDict&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://docs.python.org/3/whatsnew/2.7.html#new-and-improved-modules&quot;&gt;2.7&lt;/a&gt;, &lt;a href=&quot;https://docs.python.org/3/whatsnew/3.1.html#pep-372-ordered-dictionaries&quot;&gt;3.1&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;A dictionary subclass that keeps the key-value pairs ordered according to when the keys are inserted&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://docs.python.org/3/library/collections.html#collections.Counter&quot;&gt;&lt;code&gt;Counter&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://docs.python.org/3/whatsnew/2.7.html#new-and-improved-modules&quot;&gt;2.7&lt;/a&gt;, &lt;a href=&quot;https://docs.python.org/3/whatsnew/3.1.html#pep-372-ordered-dictionaries&quot;&gt;3.1&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;A dictionary subclass that supports convenient counting of unique items in a sequence or iterable&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://docs.python.org/3/library/collections.html#collections.ChainMap&quot;&gt;&lt;code&gt;ChainMap&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://docs.python.org/3/whatsnew/3.3.html#collections&quot;&gt;3.3&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;A dictionary-like class that allows treating a number of mappings as a single dictionary object&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;Besides these specialized data types, &lt;code&gt;collections&lt;/code&gt; also provides three base classes that facilitate the creations of custom lists, dictionaries, and &lt;a href=&quot;https://realpython.com/python-strings/&quot;&gt;strings&lt;/a&gt;:&lt;/p&gt;
&lt;div class=&quot;table-responsive&quot;&gt;
&lt;table class=&quot;table table-hover&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Class&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://docs.python.org/3/library/collections.html#collections.UserDict&quot;&gt;&lt;code&gt;UserDict&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;A wrapper class around a dictionary object that facilitates subclassing &lt;code&gt;dict&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://docs.python.org/3/library/collections.html#collections.UserList&quot;&gt;&lt;code&gt;UserList&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;A wrapper class around a list object that facilitates subclassing &lt;code&gt;list&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://docs.python.org/3/library/collections.html#collections.UserString&quot;&gt;&lt;code&gt;UserString&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;A wrapper class around a string object that facilitates subclassing &lt;code&gt;string&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;The need for these wrapper classes was partially eclipsed by the ability to subclass the corresponding standard built-in data types. However, sometimes using these classes is safer and less error-prone than using standard data types.&lt;/p&gt;
&lt;p&gt;With this brief introduction to &lt;code&gt;collections&lt;/code&gt; and the specific use cases that the data structures and classes in this module can solve, it’s time to take a closer look at them. Before that, it’s important to point out that this tutorial is an introduction to &lt;code&gt;collections&lt;/code&gt; as a whole. In most of the following sections, you’ll find a blue alert box that’ll guide you to a dedicated article on the class or function at hand.&lt;/p&gt;
&lt;h2 id=&quot;improving-code-readability-namedtuple&quot;&gt;Improving Code Readability: &lt;code&gt;namedtuple()&lt;/code&gt;&lt;a class=&quot;headerlink&quot; href=&quot;#improving-code-readability-namedtuple&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Python’s &lt;code&gt;namedtuple()&lt;/code&gt; is a &lt;a href=&quot;https://en.wikipedia.org/wiki/Factory_(object-oriented_programming)&quot;&gt;factory function&lt;/a&gt; that allows you to create &lt;code&gt;tuple&lt;/code&gt; subclasses with &lt;strong&gt;named fields&lt;/strong&gt;. These fields give you direct access to the values in a given named tuple using the &lt;strong&gt;dot notation&lt;/strong&gt;, like in &lt;code&gt;obj.attr&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The need for this feature arose because using indices to access the values in a regular tuple is annoying, difficult to read, and error-prone. This is especially true if the tuple you’re working with has several items and is constructed far away from where you’re using it.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Check out &lt;a href=&quot;https://realpython.com/python-namedtuple/&quot;&gt;Write Pythonic and Clean Code With namedtuple&lt;/a&gt; for a deeper dive into how to use &lt;code&gt;namedtuple&lt;/code&gt; in Python.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;A tuple subclass with named fields that developers can access with the dot notation seemed like a desirable feature back in Python 2.6. That’s the origin of &lt;code&gt;namedtuple()&lt;/code&gt;. The tuple subclasses you can build with this function are a big win in code readability if you compare them with regular tuples.&lt;/p&gt;
&lt;p&gt;To put the code readability problem in perspective, consider &lt;a href=&quot;https://docs.python.org/3/library/functions.html#divmod&quot;&gt;&lt;code&gt;divmod()&lt;/code&gt;&lt;/a&gt;. This built-in function takes two (non-complex) &lt;a href=&quot;https://realpython.com/python-numbers/&quot;&gt;numbers&lt;/a&gt; and returns a tuple with the &lt;strong&gt;quotient&lt;/strong&gt; and &lt;strong&gt;remainder&lt;/strong&gt; that result from the &lt;strong&gt;integer division&lt;/strong&gt; of the input values:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;span class=&quot;repl-toggle&quot; title=&quot;Toggle REPL prompts and output&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;divmod&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;(2, 2)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;It works nicely. However, is this result readable? Can you tell what the meaning of each number in the output is? Fortunately, Python offers a way to improve this. You can code a custom version of &lt;code&gt;divmod()&lt;/code&gt; with an explicit result using &lt;code&gt;namedtuple&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;span class=&quot;repl-toggle&quot; title=&quot;Toggle REPL prompts and output&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;collections&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;namedtuple&lt;/span&gt;

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

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;custom_divmod&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;result&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;DivMod(quotient=2, remainder=2)&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;quotient&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;remainder&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now you know the meaning of each value in the result. You can also access each independent value using the dot notation and a descriptive field name.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-collections-module/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-collections-module/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #70: What Can You Do With Python and Counting Objects Using &quot;Counter&quot;</title>
      <id>https://realpython.com/podcasts/rpp/70/</id>
      <link href="https://realpython.com/podcasts/rpp/70/"/>
      <updated>2021-07-23T12:00:00+00:00</updated>
      <summary>How is Python being used today, and what can you do with the language? Do you want to develop software, dive into data science and math, automate parts of your job and  digital life, or work with electronics? This week on the show, David Amos is back, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;How is Python being used today, and what can you do with the language? Do you want to develop software, dive into data science and math, automate parts of your job and  digital life, or work with electronics? This week on the show, David Amos is back, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Your First Steps With Django: Set Up a Django Project</title>
      <id>https://realpython.com/django-setup/</id>
      <link href="https://realpython.com/django-setup/"/>
      <updated>2021-07-21T14:05:12+00:00</updated>
      <summary>This tutorial provides a walkthrough and a reference for starting a Django project and app. You can use it as a quick setup guide for any future Django project and tutorial you&#x27;ll work on.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Before you can start to build the individual functionality of a new &lt;a href=&quot;https://www.djangoproject.com/&quot;&gt;Django&lt;/a&gt; web application, you always need to complete a couple of setup steps. This tutorial gives you a &lt;a href=&quot;#command-reference&quot;&gt;reference&lt;/a&gt; for the necessary steps to set up a Django project.&lt;/p&gt;
&lt;p&gt;The tutorial focuses on the initial steps you’ll need to take to start a new web application. To complete it, you’ll need to have &lt;a href=&quot;https://realpython.com/installing-python/&quot;&gt;Python installed&lt;/a&gt; and understand how to work with &lt;a href=&quot;https://realpython.com/python-virtual-environments-a-primer/&quot;&gt;virtual environments&lt;/a&gt; and Python’s package manager, &lt;a href=&quot;https://realpython.com/what-is-pip/&quot;&gt;&lt;code&gt;pip&lt;/code&gt;&lt;/a&gt;. While you won’t need much programming knowledge to complete this setup, you’ll need to &lt;a href=&quot;https://realpython.com/products/python-basics-book/&quot;&gt;know Python&lt;/a&gt; to do anything interesting with the resulting project scaffolding.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this tutorial, you’ll know how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Set up a &lt;strong&gt;virtual environment&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Install&lt;/strong&gt; Django&lt;/li&gt;
&lt;li&gt;Pin your project &lt;strong&gt;dependencies&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Set up a Django &lt;strong&gt;project&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Start a Django &lt;strong&gt;app&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Use this tutorial as your go-to reference until you’ve built so many projects that the necessary commands become second nature. Until then, follow the steps outlined below. There are also a few exercises throughout the tutorial to help reinforce what you’ve learned.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Free Bonus:&lt;/strong&gt; &lt;a href=&quot;#&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-django-resources-learing-guide&quot; data-focus=&quot;false&quot;&gt;Click here to get access to a free Django Learning Resources Guide (PDF)&lt;/a&gt; that shows you tips and tricks as well as common pitfalls to avoid when building Python + Django web applications.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;prepare-your-environment&quot;&gt;Prepare Your Environment&lt;a class=&quot;headerlink&quot; href=&quot;#prepare-your-environment&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;When you’re ready to start your new Django web application, create a new folder and navigate into it. In this folder, you’ll set up a new virtual environment using your command line:&lt;/p&gt;
&lt;div class=&quot;highlight sh&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python3 -m venv env
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This command sets up a new virtual environment named &lt;code&gt;env&lt;/code&gt; in your current working directory. Once the process is complete, you also need to activate the virtual environment:&lt;/p&gt;
&lt;div class=&quot;highlight sh&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;source&lt;/span&gt; env/bin/activate
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If the activation was successful, then you’ll see the name of your virtual environment, &lt;code&gt;(env)&lt;/code&gt;, at the beginning of your command prompt. This means that your environment setup is complete.&lt;/p&gt;
&lt;p&gt;You can learn more about how to &lt;a href=&quot;https://realpython.com/python-virtual-environments-a-primer/&quot;&gt;work with virtual environments in Python&lt;/a&gt;, and how to &lt;a href=&quot;https://realpython.com/learning-paths/perfect-your-python-development-setup/&quot;&gt;perfect your Python development setup&lt;/a&gt;, but for your Django setup, you have all you need. You can continue with installing the &lt;code&gt;django&lt;/code&gt; package.&lt;/p&gt;
&lt;h2 id=&quot;install-django-and-pin-your-dependencies&quot;&gt;Install Django and Pin Your Dependencies&lt;a class=&quot;headerlink&quot; href=&quot;#install-django-and-pin-your-dependencies&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Once you’ve created and activated your Python virtual environment, you can install Django into this dedicated development workspace:&lt;/p&gt;
&lt;div class=&quot;highlight sh&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(env)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python -m pip install django
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This command fetches the &lt;code&gt;django&lt;/code&gt; package from the &lt;a href=&quot;https://realpython.com/pypi-publish-python-package/&quot;&gt;Python Package Index (PyPI)&lt;/a&gt; using &lt;code&gt;pip&lt;/code&gt;. After the installation has completed, you can &lt;strong&gt;pin&lt;/strong&gt; your dependencies to make sure that you’re keeping track of which Django version you installed:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/django-setup/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/django-setup/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Speech Recognition With Python</title>
      <id>https://realpython.com/courses/speech-recognition-python/</id>
      <link href="https://realpython.com/courses/speech-recognition-python/"/>
      <updated>2021-07-20T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll cover the fundamentals of speech recognition with Python. You&#x27;ll learn which speech recognition library gives the best results and build a full-featured &quot;Guess The Word&quot; game with it.</summary>
      <content type="html">
        &lt;p&gt;Have you ever wondered how to add speech recognition to your Python project? It&amp;rsquo;s more straightforward than you might think. In this course, you&amp;rsquo;ll find out how.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How &lt;strong&gt;speech recognition&lt;/strong&gt; works&lt;/li&gt;
&lt;li&gt;What speech recognition &lt;strong&gt;packages&lt;/strong&gt; are available on PyPI&lt;/li&gt;
&lt;li&gt;How to install and use the &lt;strong&gt;SpeechRecognition package&lt;/strong&gt;&amp;mdash;a full-featured and straightforward Python speech recognition library&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #69: Planning a Faster Future at the Python Language Summit</title>
      <id>https://realpython.com/podcasts/rpp/69/</id>
      <link href="https://realpython.com/podcasts/rpp/69/"/>
      <updated>2021-07-16T12:00:00+00:00</updated>
      <summary>Do you wonder what the future may hold for the Python language? Are there speed improvements coming soon? What if you could be in the room while the core developers discuss Python&#x27;s future? This week on the show, we have Joanna Jablonski, who was invited to the Python Language Summit 2021 as a journalist to summarize and document the event.</summary>
      <content type="html">
        &lt;p&gt;Do you wonder what the future may hold for the Python language? Are there speed improvements coming soon? What if you could be in the room while the core developers discuss Python&#x27;s future? This week on the show, we have Joanna Jablonski, who was invited to the Python Language Summit 2021 as a journalist to summarize and document the event.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Square Root Function in Python</title>
      <id>https://realpython.com/courses/square-root-function-python/</id>
      <link href="https://realpython.com/courses/square-root-function-python/"/>
      <updated>2021-07-13T14:00:00+00:00</updated>
      <summary>In this quick and practical course, you&#x27;ll learn what a square root is and how to calculate one in Python. You&#x27;ll even see how you can use the Python square root function to solve a real-world problem.</summary>
      <content type="html">
        &lt;p&gt;Are you trying to solve a quadratic equation? Maybe you need to calculate the length of one side of a right triangle. You can use the &lt;code&gt;math&lt;/code&gt; module&amp;rsquo;s &lt;strong&gt;&lt;code&gt;sqrt()&lt;/code&gt;&lt;/strong&gt; method for determining the square root of a number. This course covers the use of &lt;code&gt;math.sqrt()&lt;/code&gt; as well as related methods.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;About &lt;strong&gt;square roots&lt;/strong&gt; and related mathematical operations&lt;/li&gt;
&lt;li&gt;How to use the Python square root function, &lt;strong&gt;&lt;code&gt;sqrt()&lt;/code&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Where &lt;code&gt;sqrt()&lt;/code&gt; can be useful in &lt;strong&gt;real-world examples&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #68: Exploring the functools Module and Complex Numbers in Python</title>
      <id>https://realpython.com/podcasts/rpp/68/</id>
      <link href="https://realpython.com/podcasts/rpp/68/"/>
      <updated>2021-07-09T12:00:00+00:00</updated>
      <summary>Are you ready to expand your Python knowledge into the intermediate to advanced territory? What tools are awaiting your discovery inside Python&#x27;s functools module? This week on the show, David Amos is back, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;Are you ready to expand your Python knowledge into the intermediate to advanced territory? What tools are awaiting your discovery inside Python&#x27;s functools module? This week on the show, David Amos is back, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Defining and Calling Python Functions</title>
      <id>https://realpython.com/courses/defining-and-calling-functions/</id>
      <link href="https://realpython.com/courses/defining-and-calling-functions/"/>
      <updated>2021-07-06T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll learn how to define and call your own Python function.  You&#x27;ll also learn about passing data to your function and returning data from your function back to its calling environment.</summary>
      <content type="html">
        &lt;p&gt;A &lt;strong&gt;function&lt;/strong&gt; is a self-contained block of code that encapsulates a specific task or related group of tasks. This course will show you how to &lt;strong&gt;define your own Python function&lt;/strong&gt;. You&amp;rsquo;ll learn when to divide your program into separate user-defined functions and what tools you&amp;rsquo;ll need to do this. &lt;/p&gt;
&lt;p&gt;You&amp;rsquo;ll also learn the various ways to pass data into a function when calling it, which allows for different behavior from one invocation to the next.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How &lt;strong&gt;functions&lt;/strong&gt; work in Python and why they&amp;rsquo;re beneficial&lt;/li&gt;
&lt;li&gt;How to &lt;strong&gt;define and call&lt;/strong&gt; your own Python function&lt;/li&gt;
&lt;li&gt;Mechanisms for &lt;strong&gt;passing arguments&lt;/strong&gt; to your function&lt;/li&gt;
&lt;li&gt;Some differences between how to work with functions in &lt;strong&gt;Python vs C++&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to &lt;strong&gt;return data&lt;/strong&gt; from your function back to the calling environment&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This course will be the most helpful for you if you&amp;rsquo;re already familiar with the fundamental concepts of Python, including &lt;a href=&quot;https://realpython.com/python-data-types/&quot;&gt;basic data types&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-lists-tuples/&quot;&gt;lists and tuples&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-dicts/&quot;&gt;dictionaries&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/lessons/import-statement/&quot;&gt;the import statement&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-conditional-statements/&quot;&gt;conditional statements&lt;/a&gt;, and &lt;a href=&quot;https://realpython.com/python-for-loop/&quot;&gt;for loops&lt;/a&gt;.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #67: Securing Your Python Software Supply Chain With Dustin Ingram</title>
      <id>https://realpython.com/podcasts/rpp/67/</id>
      <link href="https://realpython.com/podcasts/rpp/67/"/>
      <updated>2021-07-02T12:00:00+00:00</updated>
      <summary>How well do you know your software supply chain? When you PIP install a package, what steps can you take to minimize the risk of installing something malicious? This week on the show, we have Dustin Ingram, a director of the Python Software Foundation (PSF) and a maintainer of the Python Package Index (PyPI).</summary>
      <content type="html">
        &lt;p&gt;How well do you know your software supply chain? When you PIP install a package, what steps can you take to minimize the risk of installing something malicious? This week on the show, we have Dustin Ingram, a director of the Python Software Foundation (PSF) and a maintainer of the Python Package Index (PyPI).&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  

</feed>
