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

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

  
    <entry>
      <title>The Real Python Podcast – Episode #28: Using Pylance to Write Better Python Inside of Visual Studio Code</title>
      <id>https://realpython.com/podcasts/rpp/28/</id>
      <link href="https://realpython.com/podcasts/rpp/28/"/>
      <updated>2020-09-25T12:00:00+00:00</updated>
      <summary>A big decision a developer has to make is what tool to use to write code? Would you like an editor that understands Python, and is there to help with suggestions, definitions, and analysis of your code? For many developers, its the free tool, Visual Studio Code. This week on the show, we have Savannah Ostrowski, program manager for the Python Language Server and Python in Visual Studio. We discuss Pylance, a new language server with fast, feature-rich language support for Python in VS Code.</summary>
      <content type="html">
        &lt;p&gt;A big decision a developer has to make is what tool to use to write code? Would you like an editor that understands Python, and is there to help with suggestions, definitions, and analysis of your code? For many developers, its the free tool, Visual Studio Code. This week on the show, we have Savannah Ostrowski, program manager for the Python Language Server and Python in Visual Studio. We discuss Pylance, a new language server with fast, feature-rich language support for Python in VS Code.&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 Community Interview With David Amos</title>
      <id>https://realpython.com/interview-david-amos/</id>
      <link href="https://realpython.com/interview-david-amos/"/>
      <updated>2020-09-23T14:00:00+00:00</updated>
      <summary>David Amos is the content technical lead at Real Python. He&#x27;s also a co-curator of PyCoder&#x27;s Weekly and the author of the Python Basics book. Join us as we talk about all those things as well as his love for LEGO and mathematics.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;This week I’m joined by &lt;a href=&quot;https://realpython.com/team/damos/&quot;&gt;David Amos&lt;/a&gt;, the content technical lead here at &lt;em&gt;Real Python&lt;/em&gt;. &lt;/p&gt;
&lt;p&gt;In this interview, we talk about David’s love of LEGO and mathematics. We also talk about the &lt;a href=&quot;https://realpython.com/products/python-basics-book/&quot;&gt;&lt;em&gt;Python Basics&lt;/em&gt; book&lt;/a&gt;, which is soon to be out of early access, and his involvement with &lt;a href=&quot;https://pycoders.com/&quot;&gt;&lt;em&gt;PyCoder’s Weekly&lt;/em&gt;&lt;/a&gt;. So, without further ado, let’s get started.&lt;/p&gt;
&lt;p class=&quot;mt-5&quot;&gt;&lt;strong&gt;Ricky:&lt;/strong&gt; &lt;em&gt;Thank you for joining me, David. Many of our readers and members may already know your background, but for those who don’t, let’s ask the inevitable questions: How did you get into programming, and when did you start using Python?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid w-25 float-right ml-3 rounded-circle&quot; src=&quot;https://files.realpython.com/media/me-small.f5f49f1c48e1.jpg&quot; width=&quot;400&quot; height=&quot;400&quot; srcset=&quot;https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/me-small.f5f49f1c48e1.jpg&amp;amp;w=100&amp;amp;sig=38ffd9d7b49fe40a58e5868b04945ed741d6fef4 100w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/me-small.f5f49f1c48e1.jpg&amp;amp;w=200&amp;amp;sig=a308986ef202a905cf5376513299b30cb2ec7538 200w, https://files.realpython.com/media/me-small.f5f49f1c48e1.jpg 400w&quot; sizes=&quot;75vw&quot; alt=&quot;David Amos&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;David:&lt;/strong&gt; I discovered programming by accident when I came across the source code for the &lt;a href=&quot;https://archive.org/details/GorillasQbasic&quot;&gt;Gorillas game&lt;/a&gt; on my parents’ &lt;a href=&quot;https://en.wikipedia.org/wiki/IBM_Personal_System/2&quot;&gt;IBM 386 PS/2 computer&lt;/a&gt;. I guess I was about seven or eight years old. I found something called a &lt;code&gt;.BAS&lt;/code&gt; file that opened up a program called &lt;a href=&quot;https://en.wikipedia.org/wiki/QBasic&quot;&gt;QBasic&lt;/a&gt; and had all sorts of strange-looking text in it. I was instantly intrigued!&lt;/p&gt;
&lt;p&gt;There was a note at the top of the file that explained how to adjust the game speed. I changed the value and ran the game. The effect was instantly noticeable. It was a thrilling experience.&lt;/p&gt;
&lt;p&gt;I was obsessed with learning to program in QBasic. I made my own text adventure games. I even made a few animations using simple geometric shapes. It was tons of fun!&lt;/p&gt;
&lt;p&gt;QBasic was a &lt;a href=&quot;http://www.nicolasbize.com/blog/30-years-later-qbasic-is-still-the-best/&quot;&gt;fantastic language&lt;/a&gt; for an eight-year-old kid to learn. It was challenging enough to keep me interested but easy enough to get quick results, which is really important for a child.&lt;/p&gt;
&lt;p&gt;When I was around ten years old, I tried to teach myself C++. The ideas were too complex, and results came too slowly. After a few months of struggling, I stopped. But the idea of programming computers remained attractive to me—enough so that I took a web technology class in high school and learned the basics of HTML, CSS, and JavaScript.&lt;/p&gt;
&lt;p&gt;In college, I decided to major in mathematics, but I needed a minor. I chose computer science because I thought having some experience with programming would make it easier to complete the degree requirements.&lt;/p&gt;
&lt;p&gt;I learned about data structures with C++. I took an object-oriented programming class with Java. I studied operating systems and parallel computing with C. My programming horizons expanded vastly, and I found the whole subject pleasing both practically and intellectually.&lt;/p&gt;
&lt;p&gt;At that time, I viewed programming as a tool to help me with mathematics research. In graduate school, I wrote programs to generate examples and test ideas for my research projects.&lt;/p&gt;
&lt;p&gt;It was during graduate school, around 2013, that I found Python and pretty much instantly fell in love. I’d been using C++, MATLAB, and Mathematica as my primary research tools, but Python allowed me to focus on the research problem without getting caught up in the code.&lt;/p&gt;
&lt;p&gt;And with Python’s awesome ecosystem of tools for scientific computing, like &lt;a href=&quot;https://realpython.com/numpy-array-programming/&quot;&gt;NumPy&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-scipy-cluster-optimize/&quot;&gt;SciPy&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/linear-programming-python/&quot;&gt;PuLP&lt;/a&gt;, and &lt;a href=&quot;https://networkx.github.io/&quot;&gt;NetworkX&lt;/a&gt;, I had everything I needed to tackle problems &lt;a href=&quot;https://realpython.com/matlab-vs-python/&quot;&gt;like I would with MATLAB&lt;/a&gt; but in a much more expressive manner!&lt;/p&gt;
&lt;p class=&quot;mt-5&quot;&gt;&lt;strong&gt;Ricky:&lt;/strong&gt; &lt;em&gt;You often hear the myth that a strong mathematics background is a prerequisite to be a programmer. While I think you’ll agree that it’s not always necessary for programmers to know advanced math, I’m curious to know how your math and data science background has helped you when writing code.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/interview-david-amos/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/interview-david-amos/ »&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>Working With Linked Lists in Python</title>
      <id>https://realpython.com/courses/working-linked-lists-python/</id>
      <link href="https://realpython.com/courses/working-linked-lists-python/"/>
      <updated>2020-09-22T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll learn what linked lists are and when to use them, such as when you want to implement queues, stacks, or graphs. You&#x27;ll also learn how to use collections.deque to improve the performance of your linked lists and how to implement linked lists in your own projects.</summary>
      <content type="html">
        &lt;p&gt;&lt;strong&gt;Linked lists&lt;/strong&gt; are like a lesser-known cousin of &lt;a href=&quot;https://realpython.com/python-lists-tuples/&quot;&gt;lists&lt;/a&gt;. They&amp;rsquo;re not as popular or as cool, and you might not even remember them from your algorithms class. But in the right context, they can really shine. If you&amp;rsquo;re looking to brush up on your coding skills for a &lt;a href=&quot;https://realpython.com/python-coding-interview-tips/&quot;&gt;job interview&lt;/a&gt;, or if you want to learn more about &lt;a href=&quot;https://realpython.com/python-data-structures/&quot;&gt;Python data structures&lt;/a&gt; besides the usual &lt;a href=&quot;https://realpython.com/python-dicts/&quot;&gt;dictionaries&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/python-lists-tuples/&quot;&gt;lists&lt;/a&gt;, then you&amp;rsquo;ve come to the right place!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What &lt;strong&gt;linked lists&lt;/strong&gt; are and when you should use them&lt;/li&gt;
&lt;li&gt;How to use &lt;strong&gt;&lt;code&gt;collections.deque&lt;/code&gt;&lt;/strong&gt; for all of your linked list needs&lt;/li&gt;
&lt;li&gt;How to &lt;strong&gt;implement&lt;/strong&gt; your own linked lists&lt;/li&gt;
&lt;li&gt;What the &lt;strong&gt;other types&lt;/strong&gt; of linked lists are and what they can be used for&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 Practice Problems: Get Ready for Your Next Interview</title>
      <id>https://realpython.com/python-practice-problems/</id>
      <link href="https://realpython.com/python-practice-problems/"/>
      <updated>2020-09-21T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll prepare for future interviews by working through a set of Python practice problems that commonly appear in coding tests. You&#x27;ll work through the problems yourself and then compare your results with solutions developed by the Real Python team.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Are you a Python developer brushing up on your skills before an &lt;a href=&quot;https://realpython.com/learning-paths/python-interview/&quot;&gt;interview&lt;/a&gt;? If so, then this tutorial will usher you through a series of &lt;strong&gt;Python practice problems&lt;/strong&gt; meant to simulate common coding test scenarios. After you develop your own solutions, you’ll walk through  the &lt;em&gt;Real Python&lt;/em&gt; team’s answers so you can optimize your code, impress your interviewer, and land your dream job!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll learn how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Write code&lt;/strong&gt; for interview-style problems&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Discuss your solutions&lt;/strong&gt; during the interview&lt;/li&gt;
&lt;li&gt;Work through &lt;strong&gt;frequently overlooked details&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Talk about &lt;strong&gt;design decisions&lt;/strong&gt; and trade-offs&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This tutorial is aimed at intermediate Python developers. It assumes a &lt;a href=&quot;https://realpython.com/learning-paths/python3-introduction/&quot;&gt;basic knowledge of Python&lt;/a&gt; and an ability to solve problems in Python. You can get skeleton code with failing unit tests for each of the problems you’ll see in this tutorial by clicking on the link below:&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Download the sample code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-practice-problems-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-practice-problems-code&quot; data-focus=&quot;false&quot;&gt;Click here to get the code you&#x27;ll use&lt;/a&gt; to work through the Python practice problems in this tutorial.&lt;/p&gt;&lt;/div&gt;

&lt;p&gt;Each of the problems below shows the file header from this skeleton code describing the problem requirements. So download the code, fire up your favorite editor, and let’s dive into some Python practice problems!&lt;/p&gt;
&lt;h2 id=&quot;python-practice-problem-1-sum-of-a-range-of-integers&quot;&gt;Python Practice Problem 1: Sum of a Range of Integers&lt;a class=&quot;headerlink&quot; href=&quot;#python-practice-problem-1-sum-of-a-range-of-integers&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Let’s start with a warm-up question. In the first practice problem, you’ll write code to sum a &lt;a href=&quot;https://realpython.com/python-lists-tuples/&quot;&gt;list&lt;/a&gt; of &lt;a href=&quot;https://realpython.com/lessons/integers/&quot;&gt;integers&lt;/a&gt;. Each practice problem includes a problem description. This description is pulled directly from the skeleton files in the repo to make it easier to remember while you’re working on your solution.&lt;/p&gt;
&lt;p&gt;You’ll see a solution section for each problem as well. Most of the discussion will be in a collapsed section below that. Clone that repo if you haven’t already, work out a solution to the following problem, then expand the solution box to review your work.&lt;/p&gt;
&lt;h3 id=&quot;problem-description&quot;&gt;Problem Description&lt;a class=&quot;headerlink&quot; href=&quot;#problem-description&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Here’s your first problem:&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;# integersums.py&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;&quot;&quot;&quot; Sum of Integers Up To n&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    Write a function, add_it_up(), that takes a single integer as input&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;    and returns the sum of the integers from zero to the input parameter.&lt;/span&gt;

&lt;span class=&quot;sd&quot;&gt;    The function should return 0 if a non-integer is passed in.&lt;/span&gt;
&lt;span class=&quot;sd&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Remember to run the unit tests until you get them passing!&lt;/p&gt;
&lt;h3 id=&quot;problem-solution&quot;&gt;Problem Solution&lt;a class=&quot;headerlink&quot; href=&quot;#problem-solution&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Here’s some discussion of a couple of possible solutions.&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; Remember, don’t open the collapsed section below until you’re ready to look at the answer for this Python practice problem!&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;card mb-3&quot; id=&quot;collapse_card87529a&quot;&gt;
&lt;div class=&quot;card-header border-0&quot;&gt;&lt;p class=&quot;m-0&quot;&gt;&lt;button class=&quot;btn w-100&quot; data-toggle=&quot;collapse&quot; data-target=&quot;#collapse87529a&quot; aria-expanded=&quot;false&quot; aria-controls=&quot;collapse87529a&quot;&gt;&lt;span class=&quot;float-left&quot;&gt;Solution for Sum of a Range of Integers&lt;/span&gt;&lt;span class=&quot;float-right text-muted&quot;&gt;Show/Hide&lt;/span&gt;&lt;/button&gt;&lt;/p&gt;&lt;/div&gt;
&lt;div id=&quot;collapse87529a&quot; class=&quot;collapse&quot; data-parent=&quot;#collapse_card87529a&quot;&gt;&lt;div class=&quot;card-body&quot; markdown=&quot;1&quot;&gt;

&lt;p&gt;How did writing the solution go? Ready to look at the answer?&lt;/p&gt;
&lt;p&gt;For this problem, you’ll look at a few different solutions. The first of these is not so good:&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;# integersums.py&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;first&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;num&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;nb&quot;&gt;sum&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;num&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;n&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;nb&quot;&gt;sum&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;sum&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;num&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;num&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;num&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;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;sum&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;In this solution, you manually build a &lt;code&gt;while&lt;/code&gt; loop to run through the numbers &lt;code&gt;1&lt;/code&gt; through &lt;code&gt;n&lt;/code&gt;. You keep a running &lt;code&gt;sum&lt;/code&gt; and then return it when you’ve finished the loop.&lt;/p&gt;
&lt;p&gt;This solution works, but it has two problems:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;It doesn’t display your knowledge of Python and how the language simplifies tasks like this.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;It doesn’t meet the error conditions in the problem description. Passing in a &lt;a href=&quot;https://realpython.com/python-strings/&quot;&gt;string&lt;/a&gt; will result in the function throwing an exception when it should just return &lt;code&gt;0&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You’ll deal with the error conditions in the final answer below, but first let’s refine the core solution to be a bit more &lt;a href=&quot;https://realpython.com/learning-paths/writing-pythonic-code/&quot;&gt;Pythonic&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The first thing to think about is that &lt;a href=&quot;https://realpython.com/python-while-loop/&quot;&gt;&lt;code&gt;while&lt;/code&gt; loop&lt;/a&gt;. Python has powerful mechanisms for iterating over lists and ranges. Creating your own is usually unnecessary, and that’s certainly the case here. You can replace the &lt;code&gt;while&lt;/code&gt; loop with a loop that iterates over a &lt;a href=&quot;https://realpython.com/python-range/&quot;&gt;&lt;code&gt;range()&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight python&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;# integersums.py&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;better&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;sum&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;num&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&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;nb&quot;&gt;sum&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;num&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;sum&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You can see that the &lt;code&gt;for...range()&lt;/code&gt; construct has replaced your &lt;code&gt;while&lt;/code&gt; loop and shortened the code. One thing to note is that &lt;code&gt;range()&lt;/code&gt; goes up to but does not include the number given, so you need to use &lt;code&gt;n + 1&lt;/code&gt; here.&lt;/p&gt;
&lt;p&gt;This was a nice step! It removes some of the boilerplate code of looping over a range and makes your intention clearer. But there’s still more you can do here.&lt;/p&gt;
&lt;p&gt;Summing a list of integers is another thing Python is good at:&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;# integersums.py&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;even_better&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;sum&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;n&quot;&gt;n&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;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Wow! By using the built-in &lt;code&gt;sum()&lt;/code&gt;, you got this down to one line of code! While &lt;a href=&quot;https://en.wikipedia.org/wiki/Code_golf&quot;&gt;code golf&lt;/a&gt; generally doesn’t produce the most readable code, in this case you have a win-win: shorter &lt;em&gt;and&lt;/em&gt; more readable code.&lt;/p&gt;
&lt;p&gt;There’s one problem remaining, however. This code still doesn’t handle the error conditions correctly. To fix that, you can wrap your previous code in a &lt;code&gt;try...except&lt;/code&gt; block:&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;# integersums.py&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;add_it_up&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;p&quot;&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;nb&quot;&gt;sum&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;n&quot;&gt;n&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;k&quot;&gt;except&lt;/span&gt; &lt;span class=&quot;ne&quot;&gt;TypeError&lt;/span&gt;&lt;span class=&quot;p&quot;&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;mi&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;result&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This solves the problem and handles the error conditions correctly. Way to go!&lt;/p&gt;
&lt;p&gt;Occasionally, interviewers will ask this question with a fixed limit, something like “Print the sum of the first nine integers.” When the problem is phrased that way, one correct solution would be &lt;code&gt;print(45)&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If you give this answer, however, then you should follow up with code that solves the problem step by step. The trick answer is a good place to start your answer, but it’s not a great place to end.&lt;/p&gt;
&lt;p&gt;If you’d like to extend this problem, try adding an optional lower limit to &lt;code&gt;add_it_up()&lt;/code&gt; to give it more flexibility!&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;/div&gt;
&lt;h2 id=&quot;python-practice-problem-2-caesar-cipher&quot;&gt;Python Practice Problem 2: Caesar Cipher&lt;a class=&quot;headerlink&quot; href=&quot;#python-practice-problem-2-caesar-cipher&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-practice-problems/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-practice-problems/ »&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 #27: Preparing for an Interview With Python Practice Problems</title>
      <id>https://realpython.com/podcasts/rpp/27/</id>
      <link href="https://realpython.com/podcasts/rpp/27/"/>
      <updated>2020-09-18T12:00:00+00:00</updated>
      <summary>What is an effective way to prepare for a Python interview? Would you like a set of problems that increase in difficulty to practice and hone your Python skills?  This week on the show, we have Jim Anderson to talk about his new Real Python article, &quot;Python Practice Problems: Get Ready for Your Next Interview.&quot;  This article provides several problems, which include skeleton code, unit tests, and solutions for you to compare your work.</summary>
      <content type="html">
        &lt;p&gt;What is an effective way to prepare for a Python interview? Would you like a set of problems that increase in difficulty to practice and hone your Python skills?  This week on the show, we have Jim Anderson to talk about his new Real Python article, &quot;Python Practice Problems: Get Ready for Your Next Interview.&quot;  This article provides several problems, which include skeleton code, unit tests, and solutions for you to compare your work.&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>Numbers in Python</title>
      <id>https://realpython.com/python-numbers/</id>
      <link href="https://realpython.com/python-numbers/"/>
      <updated>2020-09-16T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn about numbers and basic math in Python. You&#x27;ll explore integer, floating-point numbers, and complex numbers and see how perform calculations using Python&#x27;s arithmetic operators, math functions, and number methods.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;You don’t need to be a math whiz to program well. The truth is, few programmers need to know more than basic algebra. Of course, how much math you need to know depends on the application you’re working on. In general, the level of math required to be a programmer is lower than you might expect. Although math and computer programming aren’t as correlated as some people might believe, &lt;strong&gt;numbers&lt;/strong&gt; are an integral part of any programming language, and &lt;strong&gt;Python&lt;/strong&gt; is no exception.&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;integers&lt;/strong&gt; and &lt;strong&gt;floating-point numbers&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Round numbers&lt;/strong&gt; to a given number of decimal places&lt;/li&gt;
&lt;li&gt;Format and display numbers in &lt;strong&gt;strings&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Let’s get started!&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; This tutorial is adapted from the chapter “Numbers and Math” in &lt;a href=&quot;https://realpython.com/products/python-basics-book/&quot;&gt;&lt;em&gt;Python Basics: A Practical Introduction to Python 3&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The book uses Python’s built-in IDLE editor to create and edit Python files and interact with the Python shell, so you will see references to IDLE’s built-in debugging tools throughout this tutorial. However, you should have no problems running the example code from the editor and environment of your choice.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Free Bonus:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-mastery-course/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-mastery-course&quot; data-focus=&quot;false&quot;&gt;5 Thoughts On Python Mastery&lt;/a&gt;, a free course for Python developers that shows you the roadmap and the mindset you&#x27;ll need to take your Python skills to the next level.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;integers-and-floating-point-numbers&quot;&gt;Integers and Floating-Point Numbers&lt;a class=&quot;headerlink&quot; href=&quot;#integers-and-floating-point-numbers&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Python has three built-in numeric &lt;a href=&quot;https://realpython.com/python-data-types/&quot;&gt;data types&lt;/a&gt;: integers, floating-point numbers, and complex numbers. In this section, you’ll learn about integers and floating-point numbers, which are the two most commonly used number types. You’ll learn about complex numbers in &lt;a href=&quot;#complex-numbers&quot;&gt;a later section&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&quot;integers&quot;&gt;Integers&lt;a class=&quot;headerlink&quot; href=&quot;#integers&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;An &lt;strong&gt;integer&lt;/strong&gt; is a whole number with no decimal places. For example, &lt;code&gt;1&lt;/code&gt; is an integer, but &lt;code&gt;1.0&lt;/code&gt; isn’t. The name for the integer data type is &lt;code&gt;int&lt;/code&gt;, which you can see with &lt;code&gt;type()&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;nb&quot;&gt;type&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;go&quot;&gt;&amp;lt;class &#x27;int&#x27;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You can create an integer by typing the desired number. For instance, the following assigns the integer &lt;code&gt;25&lt;/code&gt; to the variable &lt;code&gt;num&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;span class=&quot;repl-toggle&quot; title=&quot;Toggle REPL prompts and output&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;num&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;25&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;When you create an integer like this, the value &lt;code&gt;25&lt;/code&gt; is called an &lt;strong&gt;integer literal&lt;/strong&gt; because the integer is literally typed into the code.&lt;/p&gt;
&lt;p&gt;You may already be familiar with how to &lt;a href=&quot;https://realpython.com/convert-python-string-to-int/&quot;&gt;convert a string containing an integer to a number&lt;/a&gt; using &lt;code&gt;int()&lt;/code&gt;. For example, the following converts the string &lt;code&gt;&quot;25&quot;&lt;/code&gt; to the integer &lt;code&gt;25&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;nb&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;25&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;25&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;code&gt;int(&quot;25&quot;)&lt;/code&gt; is not an integer literal because the integer value is created from a string.&lt;/p&gt;
&lt;p&gt;When you write large numbers by hand, you typically group digits into groups of three separated by a comma or a decimal point. The number 1,000,000 is a lot easier to read than 1000000.&lt;/p&gt;
&lt;p&gt;In Python, you can’t use commas to group digits in integer literals, but you can use underscores (&lt;code&gt;_&lt;/code&gt;). Both of the following are valid ways to represent the number one million as an integer literal:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;span class=&quot;repl-toggle&quot; title=&quot;Toggle REPL prompts and output&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1000000&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;1000000&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1_000_000&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;1000000&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;There’s no limit to how large an integer can be, which might be surprising considering that computers have a finite amount of memory. Try typing the largest number you can think of into IDLE’s interactive window. Python can handle it with no problem!&lt;/p&gt;
&lt;h3 id=&quot;floating-point-numbers&quot;&gt;Floating-Point Numbers&lt;a class=&quot;headerlink&quot; href=&quot;#floating-point-numbers&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;A &lt;strong&gt;floating-point number&lt;/strong&gt;, or &lt;strong&gt;float&lt;/strong&gt; for short, is a number with a decimal place. &lt;code&gt;1.0&lt;/code&gt; is a floating-point number, as is &lt;code&gt;-2.75&lt;/code&gt;. The name of the floating-point data type is &lt;code&gt;float&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;nb&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;1.0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&amp;lt;class &#x27;float&#x27;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Like integers, floats can be created from &lt;strong&gt;floating-point literals&lt;/strong&gt; or by converting a string to a float with &lt;code&gt;float()&lt;/code&gt;:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-numbers/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-numbers/ »&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>Command Line Interfaces in Python</title>
      <id>https://realpython.com/courses/command-line-interfaces/</id>
      <link href="https://realpython.com/courses/command-line-interfaces/"/>
      <updated>2020-09-15T14:00:00+00:00</updated>
      <summary>Command line arguments are the key to converting your programs into useful and enticing tools that are ready to be used in the terminal of your operating system. In this course, you&#x27;ll learn their origins, standards, and basics, and how to implement them in your program.</summary>
      <content type="html">
        &lt;p&gt;Adding the capability of processing &lt;strong&gt;Python command line arguments&lt;/strong&gt; provides a user-friendly interface to your text-based command line program. It&amp;rsquo;s similar to what a graphical user interface is for a visual application that&amp;rsquo;s manipulated by graphical elements or widgets.&lt;/p&gt;
&lt;p&gt;Python exposes a mechanism to capture and extract your Python command line arguments. These values can be used to modify the behavior of a program. For example, if your program processes data read from a file, then you can pass the name of the file to your program, rather than hard-coding the value in your source code.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this course, you&amp;rsquo;ll know:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The origins&lt;/strong&gt; of Python command line arguments&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The underlying support&lt;/strong&gt; for Python command line arguments&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The standards&lt;/strong&gt; guiding the design of a command line interface&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The basics&lt;/strong&gt; to manually customize and handle Python command line arguments&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The libraries&lt;/strong&gt; available in Python to ease the development of a complex command line interface&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>Plot With Pandas: Python Data Visualization for Beginners</title>
      <id>https://realpython.com/pandas-plot-python/</id>
      <link href="https://realpython.com/pandas-plot-python/"/>
      <updated>2020-09-14T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll get to know the basic plotting possibilities that Python provides in the popular data analysis library pandas. You&#x27;ll learn about the different kinds of plots that pandas offers, how to use them for data exploration, and which types of plots are best for certain use cases.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Whether you’re just getting to know a dataset or preparing to publish your findings, &lt;strong&gt;visualization&lt;/strong&gt; is an essential tool. Python’s popular data analysis library, &lt;a href=&quot;https://pandas.pydata.org/about/&quot;&gt;pandas&lt;/a&gt;, provides several different options for visualizing your data with &lt;code&gt;.plot()&lt;/code&gt;. Even if you’re at the beginning of your pandas journey, you’ll soon be creating basic plots that will yield valuable insights into your data.&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 different types of &lt;strong&gt;pandas plots&lt;/strong&gt; are and when to use them&lt;/li&gt;
&lt;li&gt;How to get an overview of your dataset with a &lt;strong&gt;histogram&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to discover correlation with a &lt;strong&gt;scatter plot&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to analyze different &lt;strong&gt;categories&lt;/strong&gt; and their &lt;strong&gt;ratios&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Free Bonus:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/conda-cheatsheet/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-conda-cheatsheet&quot; data-focus=&quot;false&quot;&gt;Click here to get access to a Conda cheat sheet&lt;/a&gt; with handy usage examples for managing your Python environment and packages.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;set-up-your-environment&quot;&gt;Set Up Your Environment&lt;a class=&quot;headerlink&quot; href=&quot;#set-up-your-environment&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;You can best follow along with the code in this tutorial in a &lt;a href=&quot;https://realpython.com/jupyter-notebook-introduction/&quot;&gt;Jupyter Notebook&lt;/a&gt;. This way, you’ll immediately see your plots and be able to play around with them.&lt;/p&gt;
&lt;p&gt;You’ll also need a working Python environment including pandas. If you don’t have one yet, then you have several options:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;If you have more ambitious plans, then download the &lt;a href=&quot;https://www.anaconda.com/distribution/&quot;&gt;Anaconda distribution&lt;/a&gt;. It’s huge (around 500 MB), but you’ll be equipped for most data science work.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you prefer a minimalist setup, then check out the section on installing Miniconda in &lt;a href=&quot;https://realpython.com/python-windows-machine-learning-setup/&quot;&gt;Setting Up Python for Machine Learning on Windows&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you want to stick to &lt;a href=&quot;https://realpython.com/what-is-pip/&quot;&gt;&lt;code&gt;pip&lt;/code&gt;&lt;/a&gt;, then install the libraries discussed in this tutorial with &lt;code&gt;pip install pandas matplotlib&lt;/code&gt;. You can also grab Jupyter Notebook with &lt;code&gt;pip install jupyterlab&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you don’t want to do any setup, then follow along in an online &lt;a href=&quot;https://jupyter.org/try&quot;&gt;Jupyter Notebook trial&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Once your environment is set up, you’re ready to download a dataset. In this tutorial, you’re going to analyze data on college majors sourced from the &lt;a href=&quot;https://www.census.gov/newsroom/press-releases/2014/cb14-tps12.html&quot;&gt;American Community Survey 2010–2012 Public Use Microdata Sample&lt;/a&gt;. It served as the basis for the &lt;a href=&quot;https://fivethirtyeight.com/features/the-economic-guide-to-picking-a-college-major/&quot;&gt;Economic Guide To Picking A College Major&lt;/a&gt; featured on the website &lt;a href=&quot;https://fivethirtyeight.com/&quot;&gt;FiveThirtyEight&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;First, download the data by passing the download URL to &lt;code&gt;pandas.read_csv()&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;In [1]: &lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;pandas&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;pd&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;In [2]: &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;download_url&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;   ...: &lt;/span&gt;    &lt;span class=&quot;s2&quot;&gt;&quot;https://raw.githubusercontent.com/fivethirtyeight/&quot;&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;   ...: &lt;/span&gt;    &lt;span class=&quot;s2&quot;&gt;&quot;data/master/college-majors/recent-grads.csv&quot;&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;   ...: &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;In [3]: &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;df&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pd&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;read_csv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;download_url&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;In [4]: &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;df&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;gh&quot;&gt;Out[4]: &lt;/span&gt;&lt;span class=&quot;go&quot;&gt;pandas.core.frame.DataFrame&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;By calling &lt;code&gt;read_csv()&lt;/code&gt;, you create a &lt;a href=&quot;https://pandas.pydata.org/pandas-docs/stable/reference/frame.html&quot;&gt;DataFrame&lt;/a&gt;, which is the main data structure used in pandas. &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 can follow along with this tutorial even if you aren’t familiar with DataFrames. But if you’re interested in learning more about working with pandas and DataFrames, then you can check out &lt;a href=&quot;https://realpython.com/pandas-python-explore-dataset/&quot;&gt;Using Pandas and Python to Explore Your Dataset&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/pandas-dataframe/&quot;&gt;The Pandas DataFrame: Make Working With Data Delightful&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Now that you have a DataFrame, you can take a look at the data. First, you should configure the &lt;code&gt;display.max.columns&lt;/code&gt; option to make sure pandas doesn’t hide any columns. Then you can view the first few rows of data with &lt;a href=&quot;https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.head.html&quot;&gt;&lt;code&gt;.head()&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;span class=&quot;repl-toggle&quot; title=&quot;Toggle REPL prompts and output&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;In [5]: &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pd&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;set_option&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;display.max.columns&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;None&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;In [6]: &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;df&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;head&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’ve just displayed the first five rows of the DataFrame &lt;code&gt;df&lt;/code&gt; using &lt;code&gt;.head()&lt;/code&gt;. Your output should look like this:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://files.realpython.com/media/majors_df_head.31039ff82599.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/majors_df_head.31039ff82599.png&quot; width=&quot;996&quot; height=&quot;326&quot; srcset=&quot;https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/majors_df_head.31039ff82599.png&amp;amp;w=249&amp;amp;sig=24df3291308678017eb9836390c775f26616f840 249w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/majors_df_head.31039ff82599.png&amp;amp;w=498&amp;amp;sig=0b69297e403e1d8e214f42196048580cf78cbe15 498w, https://files.realpython.com/media/majors_df_head.31039ff82599.png 996w&quot; sizes=&quot;75vw&quot; alt=&quot;The output of df.head()&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The default number of rows displayed by &lt;code&gt;.head()&lt;/code&gt; is five, but you can specify any number of rows as an argument. For example, to display the first ten rows, you would use &lt;code&gt;df.head(10)&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;create-your-first-pandas-plot&quot;&gt;Create Your First Pandas Plot&lt;a class=&quot;headerlink&quot; href=&quot;#create-your-first-pandas-plot&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Your dataset contains some columns related to the earnings of graduates in each major:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;&quot;Median&quot;&lt;/code&gt;&lt;/strong&gt; is the median earnings of full-time, year-round workers.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;&quot;P25th&quot;&lt;/code&gt;&lt;/strong&gt; is the 25th percentile of earnings.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;&quot;P75th&quot;&lt;/code&gt;&lt;/strong&gt; is the 75th percentile of earnings.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;&quot;Rank&quot;&lt;/code&gt;&lt;/strong&gt; is the major’s rank by median earnings.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Let’s start with a plot displaying these columns. First, you need to set up your Jupyter Notebook to display plots with the &lt;code&gt;%matplotlib&lt;/code&gt; &lt;a href=&quot;https://ipython.readthedocs.io/en/stable/interactive/tutorial.html#magics-explained&quot;&gt;magic command&lt;/a&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;span class=&quot;repl-toggle&quot; title=&quot;Toggle REPL prompts and output&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;In [7]: &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;matplotlib&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Using matplotlib backend: MacOSX&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The &lt;code&gt;%matplotlib&lt;/code&gt; magic command sets up your Jupyter Notebook for displaying plots with Matplotlib. The standard Matplotlib graphics backend is used by default, and your plots will be displayed in a separate window.&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 can change the Matplotlib backend by passing an argument to the &lt;code&gt;%matplotlib&lt;/code&gt; magic command.&lt;/p&gt;
&lt;p&gt;For example, the &lt;code&gt;inline&lt;/code&gt; backend is popular for Jupyter Notebooks because it displays the plot in the notebook itself, immediately below the cell that creates the plot:&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;In [7]: &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;matplotlib&lt;/span&gt; inline
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;There are a number of other backends available. For more information, check out the &lt;a href=&quot;https://ipython.readthedocs.io/en/stable/interactive/plotting.html&quot;&gt;Rich Outputs tutorial&lt;/a&gt; in the IPython documentation.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/pandas-plot-python/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/pandas-plot-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 #26: 5 Years Podcasting Python with Michael Kennedy: Growth, GIL, Async, and More</title>
      <id>https://realpython.com/podcasts/rpp/26/</id>
      <link href="https://realpython.com/podcasts/rpp/26/"/>
      <updated>2020-09-11T12:00:00+00:00</updated>
      <summary>Why is Python pulling in so many new programmers? Maybe some of that growth is from Python being a full-spectrum language. This week on the show we have Michael Kennedy, the host of the podcast &quot;Talk Python to Me&quot;. Michael reflects on five years of podcasting about Python, and many of the changes he has seen in the Python landscape.</summary>
      <content type="html">
        &lt;p&gt;Why is Python pulling in so many new programmers? Maybe some of that growth is from Python being a full-spectrum language. This week on the show we have Michael Kennedy, the host of the podcast &quot;Talk Python to Me&quot;. Michael reflects on five years of podcasting about Python, and many of the changes he has seen in the Python landscape.&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>Find &amp; Fix Code Bugs in Python: Debug With IDLE</title>
      <id>https://realpython.com/python-debug-idle/</id>
      <link href="https://realpython.com/python-debug-idle/"/>
      <updated>2020-09-09T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn how to identify and fix logic errors, or bugs, in your Python code. You&#x27;ll use the built-in debugging tools in Python&#x27;s Integrated Development and Learning Environment to practice locating and resolving bugs in an example function.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Everyone makes mistakes—even seasoned professional developers! Python’s interactive interpreter, &lt;a href=&quot;https://realpython.com/python-idle/&quot;&gt;IDLE&lt;/a&gt;, is pretty good at catching mistakes like syntax errors and runtime errors, but there’s a third type of error that you may have already experienced. &lt;strong&gt;Logic errors&lt;/strong&gt; occur when an otherwise valid program doesn’t do what was intended. Logic errors cause unexpected behaviors called &lt;strong&gt;bugs&lt;/strong&gt;. Removing bugs is called &lt;strong&gt;debugging&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;A &lt;strong&gt;debugger&lt;/strong&gt; is a tool that helps you hunt down bugs and understand why they’re happening. Knowing how to find and fix bugs in your code is a skill that you’ll use for your entire coding career!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Learn how to use IDLE’s &lt;strong&gt;Debug Control&lt;/strong&gt; window&lt;/li&gt;
&lt;li&gt;Practice &lt;strong&gt;debugging&lt;/strong&gt; on a buggy function&lt;/li&gt;
&lt;li&gt;Learn &lt;strong&gt;alternative methods&lt;/strong&gt; for debugging your code&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This tutorial is adapted from the chapter “Finding and Fixing Code Bugs” in &lt;a href=&quot;https://realpython.com/products/python-basics-book/&quot;&gt;&lt;em&gt;Python Basics: A Practical Introduction to Python 3&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The book uses Python’s built-in IDLE editor to create and edit Python files and interact with the Python shell, so you will see references to IDLE’s built-in debugging tools throughout this tutorial. However, you should be able to apply the same concepts to the debugger of your choice.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Free Bonus:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-mastery-course/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-mastery-course&quot; data-focus=&quot;false&quot;&gt;5 Thoughts On Python Mastery&lt;/a&gt;, a free course for Python developers that shows you the roadmap and the mindset you&#x27;ll need to take your Python skills to the next level.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;use-the-debug-control-window&quot;&gt;Use the Debug Control Window&lt;a class=&quot;headerlink&quot; href=&quot;#use-the-debug-control-window&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The main interface to IDLE’s debugger is the Debug Control window, or the Debug window for short. You can open the Debug window by selecting &lt;em&gt;Debug→Debugger&lt;/em&gt; from the menu in the interactive window. Go ahead and open the Debug window.&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; If the Debug menu is missing from your menu bar, then make sure to bring the interactive window into focus by clicking it.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Whenever the Debug window is open, the interactive window displays &lt;code&gt;[DEBUG ON]&lt;/code&gt; next to the prompt to indicate that the debugger is open. Now open a new editor window and arrange the three windows on your screen so that you can see all of them simultaneously.&lt;/p&gt;
&lt;p&gt;In this section, you’ll learn how the Debug window is organized, how to step through your code with the debugger one line at a time, and how to set breakpoints to help speed up the debugging process.&lt;/p&gt;
&lt;h3 id=&quot;the-debug-control-window-an-overview&quot;&gt;The Debug Control Window: An Overview&lt;a class=&quot;headerlink&quot; href=&quot;#the-debug-control-window-an-overview&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;To see how the debugger works, you can start by writing a simple program without any bugs. Type the following into the editor window:&lt;/p&gt;
&lt;div class=&quot;highlight python&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;lineno&quot;&gt; 1 &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&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;lineno&quot;&gt; 2 &lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;j&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;lineno&quot;&gt; 3 &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;i is &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; and j is &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;j&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;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Save the file, then keep the Debug window open and press &lt;span class=&quot;keys&quot;&gt;&lt;kbd class=&quot;key-f5&quot;&gt;F5&lt;/kbd&gt;&lt;/span&gt;. You’ll notice that execution doesn’t get very far. &lt;/p&gt;
&lt;p&gt;The Debug window will look like this:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://files.realpython.com/media/debug_window_overview.ecfbe2ea7bd0.png&quot; target=&quot;_blank&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/debug_window_overview.ecfbe2ea7bd0.png&quot; width=&quot;832&quot; height=&quot;569&quot; srcset=&quot;https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/debug_window_overview.ecfbe2ea7bd0.png&amp;amp;w=208&amp;amp;sig=e81a7a73672b455c7fbd56fdae151a8e46b6d3be 208w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/debug_window_overview.ecfbe2ea7bd0.png&amp;amp;w=416&amp;amp;sig=ac60adcbd6808a313825acc27272ef5b1dbf504c 416w, https://files.realpython.com/media/debug_window_overview.ecfbe2ea7bd0.png 832w&quot; sizes=&quot;75vw&quot; alt=&quot;Image of IDLE&#x27;s Debug window&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Notice that the Stack panel at the top of the window contains the following message:&lt;/p&gt;
&lt;div class=&quot;highlight text&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&amp;gt; &#x27;__main__&#x27;.&amp;lt;module&amp;gt;(), line 1: for i in range(1, 4):
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This tells you that &lt;strong&gt;line 1&lt;/strong&gt; (which contains the code &lt;code&gt;for i in range(1, 4):&lt;/code&gt;) is &lt;em&gt;about&lt;/em&gt; to be run but hasn’t started yet. The &lt;code&gt;&#x27;__main__&#x27;.module()&lt;/code&gt; part of the message refers to the fact that you’re currently in the main section of the program, as opposed to being, for example, in a function definition before the main block of code has been reached.&lt;/p&gt;
&lt;p&gt;Below the Stack panel is a Locals panel that lists some strange looking stuff like &lt;code&gt;__annotations__&lt;/code&gt;, &lt;code&gt;__builtins__&lt;/code&gt;, &lt;code&gt;__doc__&lt;/code&gt;, and so on. These are internal system variables that you can ignore for now. As your program runs, you’ll see variables declared in the code displayed in this window so that you can keep track of their value.&lt;/p&gt;
&lt;p&gt;There are five buttons located at the top left-hand corner of the Debug window: &lt;em&gt;Go&lt;/em&gt;, &lt;em&gt;Step&lt;/em&gt;, &lt;em&gt;Over&lt;/em&gt;, &lt;em&gt;Out&lt;/em&gt;, and &lt;em&gt;Quit&lt;/em&gt;. These buttons control how the debugger moves through your code.&lt;/p&gt;
&lt;p&gt;In the following sections, you’ll explore what each of these buttons does, starting with &lt;em&gt;Step&lt;/em&gt;.&lt;/p&gt;
&lt;h3 id=&quot;the-step-button&quot;&gt;The Step Button&lt;a class=&quot;headerlink&quot; href=&quot;#the-step-button&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Go ahead and click &lt;em&gt;Step&lt;/em&gt; at the top left-hand corner of the Debug window. The Debug window changes a bit to look like this:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-debug-idle/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-debug-idle/ »&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>Exploring HTTPS and Cryptography in Python</title>
      <id>https://realpython.com/courses/exploring-https-cryptography/</id>
      <link href="https://realpython.com/courses/exploring-https-cryptography/"/>
      <updated>2020-09-08T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll gain a working knowledge of the various factors that combine to keep communications over the Internet safe. You&#x27;ll see concrete examples of how to keep information secure and use cryptography to build your own Python HTTPS application.</summary>
      <content type="html">
        &lt;p&gt;Have you ever wondered why it&amp;rsquo;s okay for you to send your credit card information over the Internet? You may have noticed the &lt;code&gt;https://&lt;/code&gt; on URLs in your browser, but what is it, and how does it &lt;strong&gt;keep your information safe&lt;/strong&gt;? Or perhaps you want to create a Python HTTPS application, but you&amp;rsquo;re not exactly sure what that means.&lt;/p&gt;
&lt;p&gt;In this course, you&amp;rsquo;ll get a working knowledge of the various factors that combine to keep communications over the Internet safe. You&amp;rsquo;ll see concrete examples of how a Python HTTPS application keeps information secure.&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;Monitor and analyze &lt;strong&gt;network traffic&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Apply &lt;strong&gt;cryptography&lt;/strong&gt; to keep data safe&lt;/li&gt;
&lt;li&gt;Describe the core concepts of &lt;strong&gt;Public Key Infrastructure (PKI)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Create your own &lt;strong&gt;Certificate Authority&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Build a &lt;strong&gt;Python HTTPS application&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Identify common Python HTTPS &lt;strong&gt;warnings and errors&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>Video Subtitles &amp; Transcripts Now Available on Real Python</title>
      <id>https://realpython.com/video-subtitles-transcripts-now-available/</id>
      <link href="https://realpython.com/video-subtitles-transcripts-now-available/"/>
      <updated>2020-09-07T14:00:00+00:00</updated>
      <summary>Real Python video lessons now come with full subtitles and interactive, searchable transcripts. Read the announcement to see examples and learn more.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Hey there,&lt;/p&gt;
&lt;p&gt;I’ve got a big update to share today:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Real Python video courses now have full subtitles and transcripts!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I think this is going to do a lot for accessibility and making your favorite Python learning resources easier to review &amp;amp; more searchable.&lt;/p&gt;
&lt;p&gt;Let’s do a quick demo. Video lessons now come with &lt;em&gt;full subtitles&lt;/em&gt; that you can turn on and off at your convenience:&lt;/p&gt;
&lt;p&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/embeddable_b27b28d5-31f9-488a-b1d3-27a8d8be9b67.130bb4b961fc.png&quot; width=&quot;1800&quot; height=&quot;1124&quot; srcset=&quot;https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/embeddable_b27b28d5-31f9-488a-b1d3-27a8d8be9b67.130bb4b961fc.png&amp;amp;w=450&amp;amp;sig=e8c1876d82e8f6f0adfd8b5adee91d7ea1e10778 450w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/embeddable_b27b28d5-31f9-488a-b1d3-27a8d8be9b67.130bb4b961fc.png&amp;amp;w=900&amp;amp;sig=170779a8f58608659beedb7bfc740b19bea88166 900w, https://files.realpython.com/media/embeddable_b27b28d5-31f9-488a-b1d3-27a8d8be9b67.130bb4b961fc.png 1800w&quot; sizes=&quot;75vw&quot; alt=&quot;Real Python video player with subtitles enabled&quot;&gt;&lt;/p&gt;
&lt;p&gt;Below each video you’ll also find an &lt;em&gt;interactive transcript&lt;/em&gt; that animates along with the video to show you what section of the video is currently playing:&lt;/p&gt;
&lt;p&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid mx-auto d-block border w-75&quot; src=&quot;https://files.realpython.com/media/transcript-anim.93459b7679cb.gif&quot; width=&quot;742&quot; height=&quot;516&quot; srcset=&quot;https://files.realpython.com/media/transcript-anim.93459b7679cb.gif 185w, https://files.realpython.com/media/transcript-anim.93459b7679cb.gif 371w, https://files.realpython.com/media/transcript-anim.93459b7679cb.gif 742w&quot; sizes=&quot;75vw&quot; alt=&quot;Interactive transcripts for Real Python videos&quot;&gt;&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/video-subtitles-transcripts-now-available/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/video-subtitles-transcripts-now-available/ »&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 #25: Data Version Control in Python and Real Python Video Transcripts</title>
      <id>https://realpython.com/podcasts/rpp/25/</id>
      <link href="https://realpython.com/podcasts/rpp/25/"/>
      <updated>2020-09-04T12:00:00+00:00</updated>
      <summary>Wouldn&#x27;t it be nice to a use a form of version control for data? Something that would allow you to track and version your datasets and models. Well, that&#x27;s what the tool called DVC is designed to do. This week on the show, David Amos is here and he&#x27;s brought another batch of PyCoder’s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;Wouldn&#x27;t it be nice to a use a form of version control for data? Something that would allow you to track and version your datasets and models. Well, that&#x27;s what the tool called DVC is designed to do. This week on the show, David Amos is here and he&#x27;s brought another batch of PyCoder’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>PyTorch vs Tensorflow for Your Python Deep Learning Project</title>
      <id>https://realpython.com/pytorch-vs-tensorflow/</id>
      <link href="https://realpython.com/pytorch-vs-tensorflow/"/>
      <updated>2020-09-02T14:00:00+00:00</updated>
      <summary>PyTorch vs Tensorflow: Which one should you use? Learn about these two popular deep learning libraries and how to choose the best one for your project.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;PyTorch vs TensorFlow: What’s the difference? Both are open source Python libraries that use graphs to perform numerical computation on data. Both are used extensively in academic research and commercial code. Both are extended by a variety of APIs, cloud computing platforms, and model repositories.&lt;/p&gt;
&lt;p&gt;If they’re so similar, then which one is best for your project?&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 differences are between &lt;strong&gt;PyTorch&lt;/strong&gt; and &lt;strong&gt;TensorFlow&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;What &lt;strong&gt;tools&lt;/strong&gt; and &lt;strong&gt;resources&lt;/strong&gt; are available for each&lt;/li&gt;
&lt;li&gt;How to choose the &lt;strong&gt;best option&lt;/strong&gt; for your specific use case&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You’ll start by taking a close look at both platforms, beginning with the slightly older TensorFlow, before exploring some considerations that can help you determine which choice is best for your project. Let’s get started!&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Free 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;what-is-tensorflow&quot;&gt;What Is TensorFlow?&lt;a class=&quot;headerlink&quot; href=&quot;#what-is-tensorflow&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;TensorFlow was developed by Google and released as open source in 2015. It grew out of Google’s homegrown machine learning software, which was refactored and optimized for use in production.&lt;/p&gt;
&lt;p&gt;The name “TensorFlow” describes how you organize and perform operations on data. The basic data structure for both TensorFlow and PyTorch is a &lt;a href=&quot;https://en.wikipedia.org/wiki/Tensor&quot;&gt;tensor&lt;/a&gt;. When you use TensorFlow, you perform operations on the data in these tensors by building a &lt;a href=&quot;https://www.quora.com/What-are-the-differences-between-Data-flow-model-and-State-machine-model?&quot;&gt;stateful dataflow graph&lt;/a&gt;, kind of like a flowchart that remembers past events.&lt;/p&gt;
&lt;h3 id=&quot;who-uses-tensorflow&quot;&gt;Who Uses TensorFlow?&lt;a class=&quot;headerlink&quot; href=&quot;#who-uses-tensorflow&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;TensorFlow has a reputation for being a production-grade deep learning library. It has a large and active user base and a proliferation of official and third-party tools and platforms for training, deploying, and serving models.&lt;/p&gt;
&lt;p&gt;After PyTorch was released in 2016, TensorFlow declined in popularity. But in late 2019, Google released &lt;a href=&quot;https://blog.tensorflow.org/2019/09/tensorflow-20-is-now-available.html&quot;&gt;TensorFlow 2.0&lt;/a&gt;, a major update that simplified the library and made it more user-friendly, leading to renewed interest among the machine learning community. &lt;/p&gt;
&lt;h3 id=&quot;code-style-and-function&quot;&gt;Code Style and Function&lt;a class=&quot;headerlink&quot; href=&quot;#code-style-and-function&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Before TensorFlow 2.0, TensorFlow required you to manually stitch together an &lt;a href=&quot;https://en.wikipedia.org/wiki/Abstract_syntax_tree&quot;&gt;abstract syntax tree&lt;/a&gt;—the graph—by making &lt;code&gt;tf.*&lt;/code&gt; API calls. It then required you to manually compile the model by passing a set of output tensors and input tensors to a &lt;code&gt;session.run()&lt;/code&gt; call.&lt;/p&gt;
&lt;p&gt;A &lt;code&gt;Session&lt;/code&gt; object is a &lt;a href=&quot;https://www.tensorflow.org/api_docs/python/tf/compat/v1/Session&quot;&gt;class for running TensorFlow operations&lt;/a&gt;. It contains the environment in which &lt;code&gt;Tensor&lt;/code&gt; objects are evaluated and &lt;code&gt;Operation&lt;/code&gt; objects are executed, and it can own resources like &lt;code&gt;tf.Variable&lt;/code&gt; objects. The most common way to use a &lt;code&gt;Session&lt;/code&gt; is as a &lt;a href=&quot;https://realpython.com/courses/python-context-managers-and-with-statement/&quot;&gt;context manager&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In TensorFlow 2.0, you can still build models this way, but it’s easier to use &lt;a href=&quot;https://www.tensorflow.org/guide/eager&quot;&gt;eager execution&lt;/a&gt;, which is the way Python normally works. Eager execution evaluates operations immediately, so you can write your code using Python control flow rather than graph control flow.&lt;/p&gt;
&lt;p&gt;To see the difference, let’s look at how you might multiply two tensors using each method. Here’s an example using the old TensorFlow 1.0 method:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;span class=&quot;repl-toggle&quot; title=&quot;Toggle REPL prompts and output&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;tensorflow&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;tf&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;tf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;compat&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;v1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;disable_eager_execution&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;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;compat&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;v1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;placeholder&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;float32&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;x&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;y&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;compat&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;v1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;placeholder&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;float32&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;y&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;multiply&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;multiply&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;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;with&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;compat&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;v1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Session&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;session&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;m&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;session&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;run&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;        &lt;span class=&quot;n&quot;&gt;multiply&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;feed_dict&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&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;mf&quot;&gt;2.&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;4.&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;6.&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;p&quot;&gt;[[&lt;/span&gt;&lt;span class=&quot;mf&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;mf&quot;&gt;3.&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;mf&quot;&gt;5.&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;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;    &lt;span class=&quot;nb&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;m&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[[ 2.  4.  6.]&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt; [ 6. 12. 18.]&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt; [10. 20. 30.]]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This code uses TensorFlow 2.x’s &lt;code&gt;tf.compat&lt;/code&gt; API to access TensorFlow 1.x methods and disable eager execution. &lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/pytorch-vs-tensorflow/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/pytorch-vs-tensorflow/ »&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>Editing Excel Spreadsheets in Python With openpyxl</title>
      <id>https://realpython.com/courses/editing-excel-python-openpyxl/</id>
      <link href="https://realpython.com/courses/editing-excel-python-openpyxl/"/>
      <updated>2020-09-01T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll learn how to handle spreadsheets in Python using the openpyxl package. You&#x27;ll learn how to manipulate Excel spreadsheets, extract information from spreadsheets, create simple or more complex spreadsheets, including adding styles, charts, and so on.</summary>
      <content type="html">
        &lt;p&gt;Excel spreadsheets are one of those things you might have to deal with at some point. Either it&amp;rsquo;s because your boss loves them or because marketing needs them, you might have to learn how to work with spreadsheets in Python, and that&amp;rsquo;s when knowing &lt;code&gt;openpyxl&lt;/code&gt; comes in handy!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll learn how to use openpyxl to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Read&lt;/strong&gt; Excel spreadsheets and iterate through the data&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Manipulate&lt;/strong&gt; speadsheet data using Python data structures&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Create&lt;/strong&gt; simple or more complex spreadsheets&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Format&lt;/strong&gt; workbooks using styles, filters, and conditional formatting&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Enhance&lt;/strong&gt; spreadsheets by adding images and charts&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 3 Installation &amp; Setup Guide</title>
      <id>https://realpython.com/installing-python/</id>
      <link href="https://realpython.com/installing-python/"/>
      <updated>2020-08-31T16:15:29+00:00</updated>
      <summary>The first step to getting started with Python is to install it on your machine. In this tutorial, you&#x27;ll learn how to check which version of Python, if any, you have on your Windows, Mac, or Linux computer and the best way to install the most recent version in any environment.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Installing or updating Python on your computer is the first step to becoming a Python programmer. There are a multitude of installation methods: you can download official Python distributions from &lt;a href=&quot;https://python.org&quot;&gt;Python.org&lt;/a&gt;, install from a package manager, and even install specialized distributions for scientific computing, Internet of Things, and embedded systems. &lt;/p&gt;
&lt;p&gt;This tutorial focuses on official distributions, as they’re generally the best option for getting started with learning to program in Python.&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;Check which &lt;strong&gt;version&lt;/strong&gt; of Python, if any, is installed on your machine&lt;/li&gt;
&lt;li&gt;Install or update Python on &lt;strong&gt;Windows&lt;/strong&gt;, &lt;strong&gt;macOS&lt;/strong&gt;, and &lt;strong&gt;Linux&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Use Python on &lt;strong&gt;mobile devices&lt;/strong&gt; like phones or tablets&lt;/li&gt;
&lt;li&gt;Use Python on the Web with &lt;strong&gt;online interpreters&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;No matter what operating system you’re on, this tutorial has you covered. Find your operating system below and dive 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-python-cheat-sheet-shortened&quot; data-focus=&quot;false&quot;&gt;Click here to get a Python Cheat Sheet&lt;/a&gt; and learn the basics of Python 3, like working with data types, dictionaries, lists, and Python functions.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;how-to-install-python-on-windows&quot;&gt;How to Install Python on Windows&lt;a class=&quot;headerlink&quot; href=&quot;#how-to-install-python-on-windows&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;There are three installation methods on Windows:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The Microsoft Store&lt;/li&gt;
&lt;li&gt;The full installer&lt;/li&gt;
&lt;li&gt;Windows Subsystem for Linux&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In this section, you’ll learn how to check which version of Python, if any, is installed on your Windows computer. You’ll also learn which of the three installation methods you should use.&lt;/p&gt;
&lt;h3 id=&quot;how-to-check-your-python-version-on-windows&quot;&gt;How to Check Your Python Version on Windows&lt;a class=&quot;headerlink&quot; href=&quot;#how-to-check-your-python-version-on-windows&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;To check if you already have Python on your Windows machine, first open a command-line application, such as PowerShell.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Tip:&lt;/strong&gt; Here’s how you open PowerShell:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Press the &lt;span class=&quot;keys&quot;&gt;&lt;kbd class=&quot;key-windows&quot;&gt;Win&lt;/kbd&gt;&lt;/span&gt; key.&lt;/li&gt;
&lt;li&gt;Type &lt;code&gt;PowerShell&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Press &lt;span class=&quot;keys&quot;&gt;&lt;kbd class=&quot;key-enter&quot;&gt;Enter&lt;/kbd&gt;&lt;/span&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Alternatively, you can right-click the &lt;em&gt;Start&lt;/em&gt; button and select &lt;em&gt;Windows PowerShell&lt;/em&gt; or &lt;em&gt;Windows PowerShell (Admin)&lt;/em&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;You can also use &lt;code&gt;cmd.exe&lt;/code&gt; or &lt;a href=&quot;https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701?activetab=pivot:overviewtab&quot;&gt;Windows Terminal&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;With the command line open, type in the following command and press &lt;span class=&quot;keys&quot;&gt;&lt;kbd class=&quot;key-enter&quot;&gt;Enter&lt;/kbd&gt;&lt;/span&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight doscon&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;C:\&amp;gt;&lt;/span&gt; python --version
&lt;span class=&quot;go&quot;&gt;Python 3.8.4&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Using the &lt;code&gt;--version&lt;/code&gt; switch will show you the version that’s installed. Alternatively, you can use the &lt;code&gt;-V&lt;/code&gt; switch:&lt;/p&gt;
&lt;div class=&quot;highlight doscon&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;C:\&amp;gt;&lt;/span&gt; python -V
&lt;span class=&quot;go&quot;&gt;Python 3.8.4&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;In either case, if you see a version less than &lt;code&gt;3.8.4&lt;/code&gt;, which was the most recent version at the time of writing, then you’ll want to upgrade your installation.&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; If you don’t have a version of Python on your system, then both of the above commands will launch the Microsoft Store and redirect you to the Python application page. You’ll see how to complete the installation from the Microsoft Store in the next section.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;If you’re interested in where the installation is located, then you can use the &lt;code&gt;where.exe&lt;/code&gt; command in &lt;code&gt;cmd.exe&lt;/code&gt; or PowerShell:&lt;/p&gt;
&lt;div class=&quot;highlight doscon&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;C:\&amp;gt;&lt;/span&gt; where.exe python
&lt;span class=&quot;go&quot;&gt;C:\Users\mertz\AppData\Local\Programs\Python\Python37-32\python.exe&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Note that the &lt;code&gt;where.exe&lt;/code&gt; command will work only if Python has been installed for your user account.&lt;/p&gt;
&lt;h3 id=&quot;what-your-options-are&quot;&gt;What Your Options Are&lt;a class=&quot;headerlink&quot; href=&quot;#what-your-options-are&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;As mentioned earlier, there are three ways to install the official Python distribution on Windows:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/installing-python/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/installing-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 #24: Options for Packaging Your Python Application: Wheels, Docker, and More</title>
      <id>https://realpython.com/podcasts/rpp/24/</id>
      <link href="https://realpython.com/podcasts/rpp/24/"/>
      <updated>2020-08-28T12:00:00+00:00</updated>
      <summary>Have you wondered, how should I package my Python code? You&#x27;ve written the application, but now you need to distribute it to the machines it&#x27;s intended to run on. It depends on what the code is, the libraries it depends on, and with whom do you want to share it. This week on the show we have Itamar Turner-Trauring, creator of the website pythonspeed.com. We discuss his article &quot;Options for Packaging Your Python Code: Wheels, Conda, Docker, and More,&quot; covering the how of sharing your code.</summary>
      <content type="html">
        &lt;p&gt;Have you wondered, how should I package my Python code? You&#x27;ve written the application, but now you need to distribute it to the machines it&#x27;s intended to run on. It depends on what the code is, the libraries it depends on, and with whom do you want to share it. This week on the show we have Itamar Turner-Trauring, creator of the website pythonspeed.com. We discuss his article &quot;Options for Packaging Your Python Code: Wheels, Conda, Docker, and More,&quot; covering the how of sharing your code.&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>Common Python Data Structures (Guide)</title>
      <id>https://realpython.com/python-data-structures/</id>
      <link href="https://realpython.com/python-data-structures/"/>
      <updated>2020-08-26T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn about Python&#x27;s data structures. You&#x27;ll look at several implementations of abstract data types and learn which implementations are best for your specific use cases.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;&lt;strong&gt;Data structures&lt;/strong&gt; are the fundamental constructs around which you build your programs. Each data structure provides a particular way of organizing data so it can be accessed efficiently, depending on your use case. Python ships with an extensive set of data structures in its &lt;a href=&quot;https://docs.python.org/3/library/index.html&quot;&gt;standard library&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;However, Python’s naming convention doesn’t provide the same level of clarity that you’ll find in other languages. In Java, a list isn’t just a &lt;code&gt;list&lt;/code&gt;—it’s  either a &lt;code&gt;LinkedList&lt;/code&gt; or an &lt;code&gt;ArrayList&lt;/code&gt;. Not so in Python. Even experienced Python developers sometimes wonder whether the built-in &lt;code&gt;list&lt;/code&gt; type is implemented as a &lt;a href=&quot;https://realpython.com/linked-lists-python/&quot;&gt;linked list&lt;/a&gt; or a dynamic array. &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;Which common &lt;strong&gt;abstract data types&lt;/strong&gt; are built into the Python standard library&lt;/li&gt;
&lt;li&gt;How the most common abstract data types map to Python’s &lt;strong&gt;naming scheme&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to put abstract data types to &lt;strong&gt;practical use&lt;/strong&gt; in various algorithms&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This tutorial is adapted from the chapter “Common Data Structures in Python” in &lt;a href=&quot;https://realpython.com/products/python-tricks-book/&quot;&gt;&lt;em&gt;Python Tricks: The Book&lt;/em&gt;&lt;/a&gt;. If you enjoy what you read below, then be sure to check out &lt;a href=&quot;https://realpython.com/products/python-tricks-book/&quot;&gt;the rest of the book&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Free Bonus:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-tricks-sample/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-tricks-sample&quot; data-focus=&quot;false&quot;&gt;Click here to get access to a chapter from Python Tricks: The Book&lt;/a&gt; that shows you Python&#x27;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;dictionaries-maps-and-hash-tables&quot;&gt;Dictionaries, Maps, and Hash Tables&lt;a class=&quot;headerlink&quot; href=&quot;#dictionaries-maps-and-hash-tables&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In Python, &lt;a href=&quot;https://realpython.com/python-dicts/&quot;&gt;dictionaries&lt;/a&gt; (or &lt;strong&gt;dicts&lt;/strong&gt; for short) are a central data structure. Dicts store an arbitrary number of objects, each identified by a unique dictionary &lt;strong&gt;key&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Dictionaries are also often called &lt;strong&gt;maps&lt;/strong&gt;, &lt;strong&gt;hashmaps&lt;/strong&gt;, &lt;strong&gt;lookup tables&lt;/strong&gt;, or &lt;strong&gt;associative arrays&lt;/strong&gt;. They allow for the efficient lookup, insertion, and deletion of any object associated with a given key.&lt;/p&gt;
&lt;p&gt;Phone books make a decent real-world analog for dictionary objects. They allow you to quickly retrieve the information (phone number) associated with a given key (a person’s name). Instead of having to read a phone book front to back to find someone’s number, you can jump more or less directly to a name and look up the associated information.&lt;/p&gt;
&lt;p&gt;This analogy breaks down somewhat when it comes to &lt;em&gt;how&lt;/em&gt; the information is organized to allow for fast lookups. But the fundamental performance characteristics hold. Dictionaries allow you to quickly find the information associated with a given key.&lt;/p&gt;
&lt;p&gt;Dictionaries are one of the most important and frequently used data structures in computer science. So, how does Python handle dictionaries? Let’s take a tour of the dictionary implementations available in core Python and the Python standard library.&lt;/p&gt;
&lt;h3 id=&quot;dict-your-go-to-dictionary&quot;&gt;&lt;code&gt;dict&lt;/code&gt;: Your Go-To Dictionary&lt;a class=&quot;headerlink&quot; href=&quot;#dict-your-go-to-dictionary&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Because dictionaries are so important, Python features a robust dictionary implementation that’s built directly into the core language: the &lt;a href=&quot;https://docs.python.org/3/library/stdtypes.html#mapping-types-dict&quot;&gt;&lt;code&gt;dict&lt;/code&gt;&lt;/a&gt; data type.&lt;/p&gt;
&lt;p&gt;Python also provides some useful &lt;strong&gt;syntactic sugar&lt;/strong&gt; for working with dictionaries in your programs. For example, the curly-brace ({ }) dictionary expression syntax and &lt;a href=&quot;https://realpython.com/iterate-through-dictionary-python/#using-comprehensions&quot;&gt;dictionary comprehensions&lt;/a&gt; allow you to conveniently define new dictionary objects:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;span class=&quot;repl-toggle&quot; title=&quot;Toggle REPL prompts and output&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;phonebook&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;    &lt;span class=&quot;s2&quot;&gt;&quot;bob&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;7387&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;s2&quot;&gt;&quot;alice&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3719&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;s2&quot;&gt;&quot;jack&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;7052&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;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;squares&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&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;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;6&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;phonebook&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;alice&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;3719&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;squares&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;{0: 0, 1: 1, 2: 4, 3: 9, 4: 16, 5: 25}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;There are some restrictions on which objects can be used as valid keys.&lt;/p&gt;
&lt;p&gt;Python’s dictionaries are indexed by keys that can be of any &lt;a href=&quot;https://docs.python.org/3/glossary.html#term-hashable&quot;&gt;hashable&lt;/a&gt; type. A &lt;strong&gt;hashable&lt;/strong&gt; object has a hash value that never changes during its lifetime (see &lt;code&gt;__hash__&lt;/code&gt;), and it can be compared to other objects (see &lt;code&gt;__eq__&lt;/code&gt;). Hashable objects that compare as equal must have the same hash value.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://realpython.com/courses/immutability-python/&quot;&gt;&lt;strong&gt;Immutable&lt;/strong&gt; types&lt;/a&gt; like &lt;a href=&quot;https://realpython.com/python-strings/&quot;&gt;strings&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/python-data-types/&quot;&gt;numbers&lt;/a&gt; are hashable and work well as dictionary keys. You can also use &lt;a href=&quot;https://realpython.com/python-lists-tuples/#python-tuples&quot;&gt;&lt;code&gt;tuple&lt;/code&gt; objects&lt;/a&gt; as dictionary keys as long as they contain only hashable types themselves.&lt;/p&gt;
&lt;p&gt;For most use cases, Python’s built-in dictionary implementation will do everything you need. Dictionaries are highly optimized and underlie many parts of the language. For example, &lt;a href=&quot;https://realpython.com/python-scope-legb-rule/#class-and-instance-attributes-scope&quot;&gt;class attributes&lt;/a&gt; and variables in a &lt;a href=&quot;https://en.wikipedia.org/wiki/Call_stack#Structure&quot;&gt;stack frame&lt;/a&gt; are both stored internally in dictionaries.&lt;/p&gt;
&lt;p&gt;Python dictionaries are based on a well-tested and finely tuned hash table implementation that provides the performance characteristics you’d expect: &lt;em&gt;O&lt;/em&gt;(1) time complexity for lookup, insert, update, and delete operations in the average case.&lt;/p&gt;
&lt;p&gt;There’s little reason not to use the standard &lt;code&gt;dict&lt;/code&gt; implementation included with Python. However, specialized third-party dictionary implementations exist, such as &lt;a href=&quot;https://en.wikipedia.org/wiki/Skip_list&quot;&gt;skip lists&lt;/a&gt; or &lt;a href=&quot;https://en.wikipedia.org/wiki/B-tree&quot;&gt;B-tree–based&lt;/a&gt; dictionaries.&lt;/p&gt;
&lt;p&gt;Besides plain &lt;code&gt;dict&lt;/code&gt; objects, Python’s standard library also includes a number of specialized dictionary implementations. These specialized dictionaries are all based on the built-in dictionary class (and share its performance characteristics) but also include some additional convenience features.&lt;/p&gt;
&lt;p&gt;Let’s take a look at them.&lt;/p&gt;
&lt;h3 id=&quot;collectionsordereddict-remember-the-insertion-order-of-keys&quot;&gt;&lt;code&gt;collections.OrderedDict&lt;/code&gt;: Remember the Insertion Order of Keys&lt;a class=&quot;headerlink&quot; href=&quot;#collectionsordereddict-remember-the-insertion-order-of-keys&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-data-structures/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-data-structures/ »&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>Django Redirects</title>
      <id>https://realpython.com/courses/django-redirects/</id>
      <link href="https://realpython.com/courses/django-redirects/"/>
      <updated>2020-08-25T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll learn everything you need to know about HTTP redirects in Django. All the way from the low-level details of the HTTP protocol to the high-level way of dealing with them in Django.</summary>
      <content type="html">
        &lt;p&gt;When you build web applications in Python using the &lt;a href=&quot;https://www.djangoproject.com/&quot;&gt;Django framework&lt;/a&gt;, you&amp;rsquo;ll likely need to redirect the user from one URL to another. This course covers what you need to know about redirecting in Django. All the way from the low-level details of the HTTP protocol to the high-level way of dealing with them in Django.&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;How &lt;strong&gt;HTTP Redirects&lt;/strong&gt; work&lt;/li&gt;
&lt;li&gt;The difference between &lt;strong&gt;temporary&lt;/strong&gt; and &lt;strong&gt;permanent&lt;/strong&gt; redirects&lt;/li&gt;
&lt;li&gt;How to use &lt;strong&gt;query strings&lt;/strong&gt; with a redirect&lt;/li&gt;
&lt;li&gt;How to &lt;strong&gt;avoid common problems&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 mmap: Improved File I/O With Memory Mapping</title>
      <id>https://realpython.com/python-mmap/</id>
      <link href="https://realpython.com/python-mmap/"/>
      <updated>2020-08-24T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn how to use Python&#x27;s mmap module to improve your code&#x27;s performance when you&#x27;re working with files. You&#x27;ll get a quick overview of the different types of memory before diving into how and why memory mapping with mmap can make your file I/O operations faster.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;The &lt;a href=&quot;https://www.python.org/dev/peps/pep-0020/&quot;&gt;Zen of Python&lt;/a&gt; has a lot of wisdom to offer. One especially useful idea is that “There should be one—and preferably only one—obvious way to do it.” Yet there are multiple ways to do most things in Python, and often for good reason. For example, there are &lt;a href=&quot;https://realpython.com/read-write-files-python/&quot;&gt;multiple ways to read a file in Python&lt;/a&gt;, including the rarely used &lt;code&gt;mmap&lt;/code&gt; module &lt;/p&gt;
&lt;p&gt;Python’s &lt;code&gt;mmap&lt;/code&gt; provides memory-mapped file input and output (I/O). It allows you to take advantage of lower-level operating system functionality to read files as if they were one large &lt;a href=&quot;https://realpython.com/python-strings/&quot;&gt;string&lt;/a&gt; or &lt;a href=&quot;https://dbader.org/blog/python-arrays&quot;&gt;array&lt;/a&gt;. This can provide significant performance improvements in code that requires a lot of file I/O.&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 kinds of &lt;strong&gt;computer memory&lt;/strong&gt; exist&lt;/li&gt;
&lt;li&gt;What problems you can solve with &lt;strong&gt;&lt;code&gt;mmap&lt;/code&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How use memory mapping to &lt;strong&gt;read large files faster&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to change a &lt;strong&gt;portion of a file&lt;/strong&gt; without rewriting the entire file&lt;/li&gt;
&lt;li&gt;How to use &lt;code&gt;mmap&lt;/code&gt; to &lt;strong&gt;share information&lt;/strong&gt; between multiple processes&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Free Download:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/cpython-internals-sample/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-cpython-internals-sample&quot; data-focus=&quot;false&quot;&gt;Get a sample chapter from CPython Internals: Your Guide to the Python 3 Interpreter&lt;/a&gt; showing you how to unlock the inner workings of the Python language, compile the Python interpreter from source  code, and participate in the development of CPython.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;understanding-computer-memory&quot;&gt;Understanding Computer Memory&lt;a class=&quot;headerlink&quot; href=&quot;#understanding-computer-memory&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Memory mapping&lt;/strong&gt; is a technique that uses lower-level operating system APIs to load a file directly into computer memory. It can dramatically improve file I/O performance in your program. To better understand how memory mapping improves performance, as well as how and when you can use the &lt;code&gt;mmap&lt;/code&gt; module to take advantage of these performance benefits, it’s useful to first learn a bit about computer memory.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Computer_memory&quot;&gt;Computer memory&lt;/a&gt; is a big, complicated topic, but this tutorial focuses only on what you need to know to use the &lt;code&gt;mmap&lt;/code&gt; module effectively. For the purposes of this tutorial, the term &lt;strong&gt;memory&lt;/strong&gt; refers to &lt;a href=&quot;https://en.wikipedia.org/wiki/Random-access_memory&quot;&gt;random-access memory&lt;/a&gt;, or RAM.&lt;/p&gt;
&lt;p&gt;There are several types of computer memory:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Physical&lt;/li&gt;
&lt;li&gt;Virtual&lt;/li&gt;
&lt;li&gt;Shared&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Each type of memory can come into play when you’re using memory mapping, so let’s review each one from a high level.&lt;/p&gt;
&lt;h3 id=&quot;physical-memory&quot;&gt;Physical Memory&lt;a class=&quot;headerlink&quot; href=&quot;#physical-memory&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Physical memory&lt;/strong&gt; is the least complicated type of memory to understand because it’s often part of the marketing associated with your computer. (You might remember that when you bought your computer, it advertised something like 8 gigabytes of RAM.) Physical memory typically comes on cards that are connected to your computer’s motherboard.&lt;/p&gt;
&lt;p&gt;Physical memory is the amount of &lt;a href=&quot;https://en.wikipedia.org/wiki/Volatile_memory&quot;&gt;volatile memory&lt;/a&gt; that’s available for your programs to use while running. Physical memory should not be confused with storage, such as your hard drive or solid-state disk.&lt;/p&gt;
&lt;h3 id=&quot;virtual-memory&quot;&gt;Virtual Memory&lt;a class=&quot;headerlink&quot; href=&quot;#virtual-memory&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Virtual_memory&quot;&gt;Virtual memory&lt;/a&gt; is a way of handling &lt;a href=&quot;https://realpython.com/python-memory-management/&quot;&gt;memory management&lt;/a&gt;. The operating system uses virtual memory to make it appear that you have more memory than you do, allowing you to worry less about how much memory is available for your programs at any given time. Behind the scenes, your operating system uses parts of your nonvolatile storage, such as your solid-state disk, to simulate additional RAM.&lt;/p&gt;
&lt;p&gt;In order to do this, your operating system must maintain a mapping between physical memory and virtual memory. Each operating system uses its own sophisticated algorithm to map virtual memory addresses to physical ones using a data structure called a &lt;a href=&quot;https://en.wikipedia.org/wiki/Page_table&quot;&gt;page table&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Luckily, most of this complication is hidden from your programs. You don’t need to understand page tables or logical-to-physical mapping to write performant I/O code in Python. However, knowing a little bit about memory gives you a better understanding of what the computer and libraries are taking care of for you.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;mmap&lt;/code&gt; uses virtual memory to make it appear that you’ve loaded a very large file into memory, even if the contents of the file are too big to fit in your physical memory.&lt;/p&gt;
&lt;h3 id=&quot;shared-memory&quot;&gt;Shared Memory&lt;a class=&quot;headerlink&quot; href=&quot;#shared-memory&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Shared_memory&quot;&gt;Shared memory&lt;/a&gt; is another technique provided by your operating system that allows multiple programs to access the same data simultaneously. Shared memory can be a very efficient way of handling data in a program that uses &lt;a href=&quot;https://realpython.com/python-concurrency/&quot;&gt;concurrency&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Python’s &lt;code&gt;mmap&lt;/code&gt; uses  shared memory to efficiently share large amounts of data between multiple Python processes, &lt;a href=&quot;https://realpython.com/intro-to-python-threading/&quot;&gt;threads&lt;/a&gt;, and tasks that are happening concurrently.&lt;/p&gt;
&lt;h2 id=&quot;digging-deeper-into-file-io&quot;&gt;Digging Deeper Into File I/O&lt;a class=&quot;headerlink&quot; href=&quot;#digging-deeper-into-file-io&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Now that you have a high-level view of the different types of memory, it’s time to understand what memory mapping is and what problems it solves. Memory mapping is another way to perform file I/O that can result in better performance and memory efficiency.&lt;/p&gt;
&lt;p&gt;In order to fully appreciate what memory mapping does, it’s useful to consider regular file I/O from a lower-level perspective. A lot of things happen behind the scenes when reading a file:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-mmap/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-mmap/ »&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 #23: Python Wheels and Pass by Reference in Python</title>
      <id>https://realpython.com/podcasts/rpp/23/</id>
      <link href="https://realpython.com/podcasts/rpp/23/"/>
      <updated>2020-08-21T12:00:00+00:00</updated>
      <summary>Have you wondered what are Python wheels? How are they used to package Python code? Does Python use pass by value or pass by reference? This week on the show, David Amos is here to help answer these questions, and he has brought another batch of PyCoder’s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;Have you wondered what are Python wheels? How are they used to package Python code? Does Python use pass by value or pass by reference? This week on the show, David Amos is here to help answer these questions, and he has brought another batch of PyCoder’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>Real Python Office Hours</title>
      <id>https://realpython.com/courses/office-hours/</id>
      <link href="https://realpython.com/courses/office-hours/"/>
      <updated>2020-08-18T14:00:00+00:00</updated>
      <summary>The Real Python Office Hours is a weekly hangout where members of Real Python get the chance to interact with each other as well as Real Python authors and video course instructors. Join us live on Wednesday mornings!</summary>
      <content type="html">
        &lt;p&gt;The &lt;a href=&quot;https://realpython.com/office-hours&quot;&gt;Real Python Office Hours&lt;/a&gt; is a weekly hangout where members of Real Python get the chance to meet fellow Pythonistas to chat about your learning progress, ask questions, and discuss Python tips &amp;amp; tricks via screen sharing.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this video course, you can:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;View previous office hours meetings&lt;/li&gt;
&lt;li&gt;Download the chat transcript from each meeting&lt;/li&gt;
&lt;li&gt;Explore resources and bonus materials discussed during each meeting&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Office Hours Schedule &amp;amp; Registration:&lt;/strong&gt; Join us live for the next members-only Q&amp;amp;A session with the Real Python Team: &lt;a href=&quot;https://realpython.com/office-hours/&quot;&gt;View upcoming Office Hours events »&lt;/a&gt;&lt;/p&gt;
&lt;/div&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 #22: Create Cross-Platform Python GUI Apps With BeeWare</title>
      <id>https://realpython.com/podcasts/rpp/22/</id>
      <link href="https://realpython.com/podcasts/rpp/22/"/>
      <updated>2020-08-14T12:00:00+00:00</updated>
      <summary>Do you want to distribute your Python applications to other users who don&#x27;t have or even use Python? Maybe you&#x27;re interested in seeing your Python application run on iOS or Android mobile devices. This week on the show we have Russell Keith-Magee, the founder and maintainer of the BeeWare project. Russell talks about Briefcase, a tool that converts a Python application into native installers on macOS, Windows, Linux, and mobile devices.</summary>
      <content type="html">
        &lt;p&gt;Do you want to distribute your Python applications to other users who don&#x27;t have or even use Python? Maybe you&#x27;re interested in seeing your Python application run on iOS or Android mobile devices. This week on the show we have Russell Keith-Magee, the founder and maintainer of the BeeWare project. Russell talks about Briefcase, a tool that converts a Python application into native installers on macOS, Windows, Linux, and mobile devices.&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>Identify Invalid Python Syntax</title>
      <id>https://realpython.com/courses/identify-invalid-syntax/</id>
      <link href="https://realpython.com/courses/identify-invalid-syntax/"/>
      <updated>2020-08-11T14:00:00+00:00</updated>
      <summary>In this video course, you&#x27;ll see common examples of invalid syntax in Python and learn how to resolve the issue. If you&#x27;ve ever received a SyntaxError when trying to run your Python code, then this is the guide for you!</summary>
      <content type="html">
        &lt;p&gt;Python is known for its simple syntax. However, when you&amp;rsquo;re learning Python for the first time or when you&amp;rsquo;ve come to Python with a solid background in another programming language, you may run into some things that Python doesn&amp;rsquo;t allow. If you&amp;rsquo;ve ever received a &lt;strong&gt;&lt;code&gt;SyntaxError&lt;/code&gt;&lt;/strong&gt; when trying to run your Python code, then this guide can help you. Throughout this course, you&amp;rsquo;ll see common examples of invalid syntax in Python and learn how to resolve the issue.  &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this course, you&amp;rsquo;ll be able to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Identify &lt;strong&gt;invalid syntax&lt;/strong&gt; in Python&lt;/li&gt;
&lt;li&gt;Make sense of &lt;strong&gt;SyntaxError&lt;/strong&gt; tracebacks&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Resolve&lt;/strong&gt; invalid syntax or prevent it altogether&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 #21: Exploring K-means Clustering and Building a Gradebook With Pandas</title>
      <id>https://realpython.com/podcasts/rpp/21/</id>
      <link href="https://realpython.com/podcasts/rpp/21/"/>
      <updated>2020-08-07T12:00:00+00:00</updated>
      <summary>Do you  want to learn the how and when of implementing K-means clustering in Python? Would you like to practice your pandas skills with a real-world project? This week on the show, David Amos is back with another batch of PyCoder’s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;Do you  want to learn the how and when of implementing K-means clustering in Python? Would you like to practice your pandas skills with a real-world project? This week on the show, David Amos is back with another batch of PyCoder’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>Practical Recipes for Working With Files in Python</title>
      <id>https://realpython.com/courses/practical-recipes-files/</id>
      <link href="https://realpython.com/courses/practical-recipes-files/"/>
      <updated>2020-08-04T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll learn how you can work with files in Python by using built-in modules to perform practical tasks that involve groups of files, like renaming them, moving them around, archiving them, and getting their metadata.</summary>
      <content type="html">
        &lt;p&gt;Python has several built-in modules and functions for &lt;strong&gt;handling files&lt;/strong&gt;. These functions are spread out over several modules such as &lt;code&gt;os&lt;/code&gt;, &lt;code&gt;os.path&lt;/code&gt;, &lt;code&gt;shutil&lt;/code&gt;, and &lt;code&gt;pathlib&lt;/code&gt;, to name a few. This course gathers in one place many of the functions you need to know in order to perform the most common operations on files 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;Retrieve file &lt;strong&gt;properties&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Create &lt;strong&gt;directories&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Match patterns in &lt;strong&gt;filenames&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Traverse &lt;strong&gt;directory trees&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Make &lt;strong&gt;temporary files&lt;/strong&gt; and directories&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Delete&lt;/strong&gt; files and directories&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Copy&lt;/strong&gt;, &lt;strong&gt;move&lt;/strong&gt;, or &lt;strong&gt;rename&lt;/strong&gt; files and directories&lt;/li&gt;
&lt;li&gt;Create and extract &lt;strong&gt;ZIP&lt;/strong&gt; archives&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 #20: Building PDFs in Python with ReportLab</title>
      <id>https://realpython.com/podcasts/rpp/20/</id>
      <link href="https://realpython.com/podcasts/rpp/20/"/>
      <updated>2020-07-31T12:00:00+00:00</updated>
      <summary>Have you wanted to generate advanced reports as PDFs using Python? Maybe you want to build documents with tables, images, or fillable forms. This week on the show we have Mike Driscoll to talk about his book &quot;ReportLab - PDF Processing with Python.&quot;</summary>
      <content type="html">
        &lt;p&gt;Have you wanted to generate advanced reports as PDFs using Python? Maybe you want to build documents with tables, images, or fillable forms. This week on the show we have Mike Driscoll to talk about his book &quot;ReportLab - PDF Processing with Python.&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&#x27;s None: Null in Python</title>
      <id>https://realpython.com/courses/python-none/</id>
      <link href="https://realpython.com/courses/python-none/"/>
      <updated>2020-07-28T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll learn about the NoneType object None, which acts as the null in Python. This object represents emptiness, and you can use it to mark default parameters and even show when you have no result. None is a tool for doing everything with nothing!</summary>
      <content type="html">
        &lt;p&gt;If you have experience with other programming languages, like &lt;a href=&quot;https://realpython.com/build-python-c-extension-module/&quot;&gt;C&lt;/a&gt; or &lt;a href=&quot;https://realpython.com/oop-in-python-vs-java/&quot;&gt;Java&lt;/a&gt;, then you&amp;rsquo;ve probably heard of the concept of &lt;strong&gt;&lt;code&gt;null&lt;/code&gt;&lt;/strong&gt;. Many languages use this to represent a &lt;a href=&quot;https://realpython.com/pointers-in-python/&quot;&gt;pointer&lt;/a&gt; that doesn&amp;rsquo;t point to anything, to denote when a variable is empty, or to mark default parameters that you haven&amp;rsquo;t yet supplied. &lt;code&gt;null&lt;/code&gt; is often defined to be &lt;code&gt;0&lt;/code&gt; in those languages, but &lt;code&gt;null&lt;/code&gt; in Python is different.&lt;/p&gt;
&lt;p&gt;Python uses the &lt;a href=&quot;https://realpython.com/python-keywords/&quot;&gt;keyword&lt;/a&gt; &lt;code&gt;None&lt;/code&gt; to define &lt;code&gt;null&lt;/code&gt; objects and variables. While &lt;code&gt;None&lt;/code&gt; does serve some of the same purposes as &lt;code&gt;null&lt;/code&gt; in other languages, it&amp;rsquo;s another beast entirely. As the &lt;code&gt;null&lt;/code&gt; in Python, &lt;code&gt;None&lt;/code&gt; is not defined to be &lt;code&gt;0&lt;/code&gt; or any other value. In Python, &lt;code&gt;None&lt;/code&gt; is an object and a first-class citizen!&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 &lt;strong&gt;&lt;code&gt;None&lt;/code&gt;&lt;/strong&gt; is and how to test for it&lt;/li&gt;
&lt;li&gt;When and why to use &lt;code&gt;None&lt;/code&gt; as a &lt;strong&gt;default parameter&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;What &lt;code&gt;None&lt;/code&gt; and &lt;code&gt;NoneType&lt;/code&gt; mean in your &lt;strong&gt;traceback&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to use &lt;code&gt;None&lt;/code&gt; in &lt;strong&gt;type checking&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How &lt;strong&gt;&lt;code&gt;null&lt;/code&gt; in Python&lt;/strong&gt; works under the hood&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 #19: Advanced Python Import Techniques and Managing Users in Django</title>
      <id>https://realpython.com/podcasts/rpp/19/</id>
      <link href="https://realpython.com/podcasts/rpp/19/"/>
      <updated>2020-07-24T12:00:00+00:00</updated>
      <summary>Would you like to clearly understand what&#x27;s happening when you use the Python import keyword? Do you want to use modules more effectively to structure your code? Or maybe you&#x27;re ready to move to the next level with your Django project by adding user management. This week on the show, David Amos is back with another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;Would you like to clearly understand what&#x27;s happening when you use the Python import keyword? Do you want to use modules more effectively to structure your code? Or maybe you&#x27;re ready to move to the next level with your Django project by adding user management. This week on the show, David Amos is back with 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>Mastering Python&#x27;s Built-in time Module</title>
      <id>https://realpython.com/courses/mastering-time-module/</id>
      <link href="https://realpython.com/courses/mastering-time-module/"/>
      <updated>2020-07-21T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll learn how to use the Python time module to represent dates and times in your application, manage code execution, and measure performance.</summary>
      <content type="html">
        &lt;p&gt;The Python &lt;code&gt;time&lt;/code&gt; module provides many ways of &lt;strong&gt;representing time&lt;/strong&gt; in code, such as objects, numbers, and strings. It also provides functionality other than representing time, like waiting during code execution and measuring the efficiency of your code.&lt;/p&gt;
&lt;p&gt;This course will walk you through the most commonly used functions and objects in &lt;code&gt;time&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this course, you&amp;rsquo;ll be able to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Understand&lt;/strong&gt; core concepts at the heart of working with dates and times, such as epochs, time zones, and daylight savings time&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Represent&lt;/strong&gt; time in code using floats, tuples, and &lt;code&gt;struct_time&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Convert&lt;/strong&gt; between different time representations&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Suspend&lt;/strong&gt; thread execution&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Measure&lt;/strong&gt; code performance using &lt;code&gt;perf_counter()&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  

</feed>
