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

  
    <entry>
      <title>Python Operators and Expressions</title>
      <id>https://realpython.com/courses/python-operators-expressions/</id>
      <link href="https://realpython.com/courses/python-operators-expressions/"/>
      <updated>2025-11-11T14:00:00+00:00</updated>
      <summary>Operators let you combine objects to create expressions that perform computations -- the core of how Python works.</summary>
      <content type="html">
        &lt;p&gt;Python operators enable you to perform computations by combining objects and operators into expressions. Understanding Python operators is essential for manipulating data effectively.&lt;/p&gt;
&lt;p&gt;This video course covers arithmetic, comparison, Boolean, identity, membership, bitwise, concatenation, and repetition operators, along with augmented assignment operators. You&amp;rsquo;ll also learn how to build expressions using these operators and explore operator precedence to understand the order of operations in complex expressions.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this video course, you&amp;rsquo;ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Arithmetic operators&lt;/strong&gt; perform mathematical calculations on numeric values.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Comparison operators&lt;/strong&gt; evaluate relationships between values, returning &lt;strong&gt;Boolean&lt;/strong&gt; results.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Boolean operators&lt;/strong&gt; create compound logical expressions.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Identity operators&lt;/strong&gt; determine if two operands refer to the same object.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Membership operators&lt;/strong&gt; check for the presence of a value in a container.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bitwise operators&lt;/strong&gt; manipulate data at the binary level.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Concatenation and repetition operators&lt;/strong&gt; manipulate sequence data types.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Augmented assignment operators&lt;/strong&gt; simplify expressions involving the same variable.&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.14 Released and Other Python News for November 2025</title>
      <id>https://realpython.com/python-news-november-2025/</id>
      <link href="https://realpython.com/python-news-november-2025/"/>
      <updated>2025-11-10T14:00:00+00:00</updated>
      <summary>Python 3.14 is officially out, Python 3.15 begins, and Python 3.9 reaches end of life. Plus, Django 6.0 first beta released, new PEPs, and more Python news.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Python 3.14 is out now, bringing t-strings, deferred annotations, better error messages, and plenty more to explore. As developers start adopting the new version, Python 3.15 begins its alpha phase, and Python 3.9 officially retires. Meanwhile, Django 6.0 enters beta, new PEPs propose lazy imports and changes to the &lt;code&gt;assert&lt;/code&gt; syntax, and the PSF makes waves with a notable funding decision.&lt;/p&gt;
&lt;p&gt;Here’s what’s been happening in the world of Python!&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Join Now:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/newsletter/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-newsletter&quot; markdown&gt;Click here to join the Real Python Newsletter&lt;/a&gt; and you’ll never miss another Python tutorial, course, or news update.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;python-releases&quot;&gt;Python Releases&lt;a class=&quot;headerlink&quot; href=&quot;#python-releases&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Last month’s headline news was the release of &lt;strong&gt;Python 3.14&lt;/strong&gt;—a milestone update that introduces significant enhancements to the language itself and its runtime. Meanwhile, hot on its heels, the core team has begun development of &lt;strong&gt;Python 3.15&lt;/strong&gt;. As Python continues to evolve, we must also bid farewell to an older release. &lt;strong&gt;Python 3.9&lt;/strong&gt; has reached its end of life, reminding everyone to keep their environments up to date for safety and support.&lt;/p&gt;
&lt;h3 id=&quot;python-314-final-released&quot;&gt;Python 3.14 Final Released&lt;a class=&quot;headerlink&quot; href=&quot;#python-314-final-released&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://www.python.org/downloads/release/python-3140/&quot;&gt;Python 3.14.0&lt;/a&gt; was released on &lt;a href=&quot;https://peps.python.org/pep-0745/&quot;&gt;October 7, 2025&lt;/a&gt;, delivering a packed set of improvements and new capabilities. This is a major release that the community has been eagerly awaiting, and it doesn’t disappoint. Some of the most notable features of Python 3.14 include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://realpython.com/python-annotations/&quot;&gt;Deferred annotations by default&lt;/a&gt;:&lt;/strong&gt; Following years of work on &lt;a href=&quot;https://peps.python.org/pep-0563/&quot;&gt;PEP 563&lt;/a&gt;, &lt;a href=&quot;https://peps.python.org/pep-0649/&quot;&gt;PEP 649&lt;/a&gt;, and &lt;a href=&quot;https://peps.python.org/pep-0749/&quot;&gt;PEP 749&lt;/a&gt;, Python now evaluates &lt;a href=&quot;/ref/glossary/annotation/&quot; class=&quot;ref-link&quot;&gt;type annotations&lt;/a&gt; lazily. Forward references in annotations no longer need a special &lt;code&gt;__future__&lt;/code&gt; import, and a new &lt;code&gt;annotationlib&lt;/code&gt; module provides tools to introspect annotations as real objects instead of strings.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://realpython.com/python-t-strings/&quot;&gt;Template strings (t-strings)&lt;/a&gt;:&lt;/strong&gt; &lt;a href=&quot;https://peps.python.org/pep-0750/&quot;&gt;PEP 750&lt;/a&gt; introduces t-strings, a new string literal prefix &lt;code&gt;t&quot;&quot;&lt;/code&gt; that returns a &lt;code&gt;Template&lt;/code&gt; object, capturing both static and interpolated parts of the string. This feature enables custom processing of string templates and safer substitution patterns, offering a more controlled alternative to &lt;a href=&quot;https://realpython.com/python-f-strings/&quot;&gt;f-strings&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://realpython.com/python-repl-autocompletion-highlighting/&quot;&gt;Modernized REPL&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/python314-error-messages/&quot;&gt;error messages&lt;/a&gt;:&lt;/strong&gt; Building on improvements from &lt;a href=&quot;https://realpython.com/python313-new-features/&quot;&gt;Python 3.13&lt;/a&gt;, the interactive &lt;a href=&quot;https://realpython.com/python-repl/&quot;&gt;Python REPL&lt;/a&gt; gets real-time syntax highlighting and smarter auto-completion. Syntax and runtime errors are also more informative and user-friendly, helping developers diagnose issues faster.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Multiple interpreters in the standard library:&lt;/strong&gt; &lt;a href=&quot;https://peps.python.org/pep-0734/&quot;&gt;PEP 734&lt;/a&gt; adds a &lt;code&gt;concurrent.interpreters&lt;/code&gt; module, finally exposing Python’s long-existing &lt;a href=&quot;https://realpython.com/python312-subinterpreters/&quot;&gt;multiple interpreter support&lt;/a&gt; to Python code. This allows spawning isolated interpreters within a single process, unlocking new &lt;a href=&quot;https://realpython.com/python-concurrency/&quot;&gt;concurrency&lt;/a&gt; models and multi-core usage without separate processes.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Free-threaded Python:&lt;/strong&gt; An officially supported &lt;a href=&quot;https://realpython.com/python313-free-threading-jit/&quot;&gt;build variant&lt;/a&gt; allows running Python without the &lt;a href=&quot;https://realpython.com/python-gil/&quot;&gt;Global Interpreter Lock (GIL)&lt;/a&gt;, paving the way for true multi-core parallelism.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In addition to these headline features, Python 3.14 comes with numerous smaller enhancements and optimizations. There’s a new &lt;code&gt;compression.zstd&lt;/code&gt; module for &lt;a href=&quot;https://en.wikipedia.org/wiki/Zstd&quot;&gt;Zstandard&lt;/a&gt; compression (&lt;a href=&quot;https://peps.python.org/pep-0784/&quot;&gt;PEP 784&lt;/a&gt;) and support for UUID versions 6-8 with faster generation for existing versions. Additionally, there are optional brackets in &lt;code&gt;except&lt;/code&gt; statements (&lt;a href=&quot;https://peps.python.org/pep-0758/&quot;&gt;PEP 758&lt;/a&gt;) and built-in HMAC implementations from the &lt;a href=&quot;https://github.com/hacl-star/hacl-star/&quot;&gt;HACL*&lt;/a&gt; project for improved security.&lt;/p&gt;
&lt;p&gt;The standard library tools like &lt;code&gt;unittest&lt;/code&gt;, &lt;code&gt;argparse&lt;/code&gt;, &lt;code&gt;json&lt;/code&gt;, and &lt;code&gt;calendar&lt;/code&gt; now produce colored output on the terminal, and the new zero-overhead debugger interface (&lt;a href=&quot;https://peps.python.org/pep-0768/&quot;&gt;PEP 768&lt;/a&gt;) lays the groundwork for more powerful &lt;a href=&quot;/ref/glossary/debugging/&quot; class=&quot;ref-link&quot;&gt;debugging&lt;/a&gt; tools. Official installers for Python 3.14 even include an experimental JIT compiler enabled by default, hinting at performance boosts on the horizon.&lt;/p&gt;
&lt;p&gt;With so much new in &lt;a href=&quot;https://realpython.com/python314-new-features/&quot;&gt;Python 3.14&lt;/a&gt;, now is a great time to experiment with it. Many of these features, like t-strings and annotation changes, are fully available by default, while others, such as the no-GIL build or JIT, may require special opt-in. You can read more in the official &lt;a href=&quot;https://docs.python.org/3/whatsnew/3.14.html&quot;&gt;What’s new in Python 3.14&lt;/a&gt; document for a comprehensive overview.&lt;/p&gt;
&lt;p&gt;As always, be sure to check that your critical third-party libraries support Python 3.14 before upgrading in production, but initial support is strong with many popular projects already shipping &lt;a href=&quot;/ref/glossary/wheel/&quot; class=&quot;ref-link&quot;&gt;wheels&lt;/a&gt; for 3.14. Congratulations to the core developers and community on this significant release!&lt;/p&gt;
&lt;h3 id=&quot;python-315-alpha-1-released&quot;&gt;Python 3.15 Alpha 1 Released&lt;a class=&quot;headerlink&quot; href=&quot;#python-315-alpha-1-released&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Even as Python 3.14 takes center stage, the core development team has promptly turned the page to Python 3.15. In mid-October, &lt;a href=&quot;https://www.python.org/downloads/release/python-3150a1/&quot;&gt;Python 3.15.0a1&lt;/a&gt; was released as the first &lt;a href=&quot;https://en.wikipedia.org/wiki/Software_release_life_cycle#Alpha&quot;&gt;alpha&lt;/a&gt; of the next version. This overlap is part of Python’s now-annual cadence—while one version is finalized, planning and development for the next are already in motion.&lt;/p&gt;
&lt;p&gt;Python 3.15 is scheduled for final release in October 2026. The alpha period, which will run through April 2026, is when new features land. As of alpha 1, only a few initial enhancements are present, since many features are still under development.&lt;/p&gt;
&lt;p&gt;Notably, Python 3.15.0a1 includes &lt;a href=&quot;https://peps.python.org/pep-0686/&quot;&gt;PEP 686&lt;/a&gt;, which will make &lt;a href=&quot;https://en.wikipedia.org/wiki/UTF-8&quot;&gt;UTF-8&lt;/a&gt; the default &lt;a href=&quot;https://realpython.com/python-encodings-guide/&quot;&gt;character encoding&lt;/a&gt; for open files, eliminating locale-dependent default encodings. It also has a new dedicated profiling API (&lt;a href=&quot;https://peps.python.org/pep-0799/&quot;&gt;PEP 799&lt;/a&gt;) to better support performance, and a C API for more efficient &lt;a href=&quot;/ref/glossary/bytes-like-object/&quot; class=&quot;ref-link&quot;&gt;&lt;code&gt;bytes&lt;/code&gt; object&lt;/a&gt; creation (&lt;a href=&quot;https://peps.python.org/pep-0782/&quot;&gt;PEP 782&lt;/a&gt;). Naturally, improvements to error messages continue as well.&lt;/p&gt;
&lt;p&gt;Alpha releases are intended for testing only. You wouldn’t use them in production, but they’re invaluable for library maintainers and curious users to try out emerging changes. If you maintain a &lt;a href=&quot;https://realpython.com/pypi-publish-python-package/&quot;&gt;distribution package&lt;/a&gt;, now is a good time to start ensuring compatibility with Python 3.15. And if you’re just interested in what’s coming, you can &lt;a href=&quot;https://realpython.com/python-pre-release/&quot;&gt;install a pre-release version&lt;/a&gt; alongside your stable Python.&lt;/p&gt;
&lt;p&gt;The &lt;a href=&quot;https://peps.python.org/pep-0790/&quot;&gt;Python 3.15 Release Schedule&lt;/a&gt; lays out the roadmap with monthly alpha releases through early 2026, a feature freeze by May (&lt;a href=&quot;https://en.wikipedia.org/wiki/Software_release_life_cycle#Beta&quot;&gt;beta phase&lt;/a&gt;), and a final 3.15.0 release. This overlapping development cycle means we get to enjoy new Python features every year without missing a beat.&lt;/p&gt;
&lt;p&gt;One side benefit of testing alpha releases is that you can provide feedback or catch regressions early. So, if
you have time, give 3.15.0a1 a spin in a test environment. It’s an exciting glimpse into Python’s future, even
if most of the big changes are yet to come in subsequent alphas.&lt;/p&gt;
&lt;h3 id=&quot;python-39-reaches-end-of-life&quot;&gt;Python 3.9 Reaches End of Life&lt;a class=&quot;headerlink&quot; href=&quot;#python-39-reaches-end-of-life&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Exactly five years after its initial release, &lt;a href=&quot;https://realpython.com/python39-new-features/&quot;&gt;Python 3.9&lt;/a&gt; has officially reached its end of life (EOL) as of October 2025. This means that Python 3.9 will no longer receive security fixes or bug patches going forward. If you’re still using Python 3.9 in any projects, then now is the time to plan an upgrade to a later version—&lt;a href=&quot;https://realpython.com/python310-new-features/&quot;&gt;Python 3.10&lt;/a&gt; or later—because continuing to run an EOL Python version poses security risks.&lt;/p&gt;
&lt;p&gt;The end of life comes as no surprise. &lt;a href=&quot;https://peps.python.org/pep-0596/&quot;&gt;PEP 596&lt;/a&gt; set Python 3.9’s support timeline to expire in October 2025. The core developers prepared one final security release, &lt;a href=&quot;https://www.python.org/downloads/release/python-3925/&quot;&gt;Python 3.9.25&lt;/a&gt;, which was published on Halloween (October 31, 2025) as a last hurrah for the 3.9 series. In a lighthearted announcement, release manager &lt;a href=&quot;https://lukasz.langa.pl/&quot;&gt;Łukasz Langa&lt;/a&gt; quipped that:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Python 3.9 is now officially dead… since it’s Halloween 🎃 (&lt;a href=&quot;https://discuss.python.org/t/the-final-python-3-9-security-fix-release-is-out/104666&quot;&gt;Source&lt;/a&gt;)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;With that release, the &lt;code&gt;3.9&lt;/code&gt; branch in CPython’s GitHub repository is now closed, and no further updates will be made.&lt;/p&gt;
&lt;p&gt;Why does this matter? Running an unsupported Python means that any new vulnerabilities discovered in the interpreter or the &lt;a href=&quot;/ref/glossary/standard-library/&quot; class=&quot;ref-link&quot;&gt;standard library&lt;/a&gt; won’t be patched for that version. In today’s security climate, that’s a serious concern.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-news-november-2025/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-news-november-2025/ »&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 #273: Advice for Writing Maintainable Python Code</title>
      <id>https://realpython.com/podcasts/rpp/273/</id>
      <link href="https://realpython.com/podcasts/rpp/273/"/>
      <updated>2025-11-07T12:00:00+00:00</updated>
      <summary>What are techniques for writing maintainable Python code? How do you make your Python more readable and easier to refactor? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;What are techniques for writing maintainable Python code? How do you make your Python more readable and easier to refactor? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Python MarkItDown: Convert Documents Into LLM-Ready Markdown</title>
      <id>https://realpython.com/python-markitdown/</id>
      <link href="https://realpython.com/python-markitdown/"/>
      <updated>2025-11-05T14:00:00+00:00</updated>
      <summary>Get started with Python MarkItDown to turn PDFs, Office files, images, and URLs into clean, LLM-ready Markdown in seconds.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;The MarkItDown library lets you quickly turn PDFs, Office files, images, HTML, audio, and URLs into LLM-ready Markdown. In this tutorial, you’ll compare MarkItDown with Pandoc, run it from the command line, use it in Python code, and integrate conversions into AI-powered workflows.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this tutorial, you’ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You can &lt;strong&gt;install MarkItDown&lt;/strong&gt; with &lt;code&gt;pip&lt;/code&gt; using the &lt;strong&gt;&lt;code&gt;[all]&lt;/code&gt;&lt;/strong&gt; specifier to pull in optional dependencies.&lt;/li&gt;
&lt;li&gt;The CLI’s results can be saved to a file using the &lt;strong&gt;&lt;code&gt;-o&lt;/code&gt;&lt;/strong&gt; or &lt;strong&gt;&lt;code&gt;--output&lt;/code&gt;&lt;/strong&gt; command-line option followed by a target path.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;&lt;code&gt;.convert()&lt;/code&gt;&lt;/strong&gt; method reads the input document and converts it to &lt;strong&gt;Markdown text&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;You can connect MarkItDown’s &lt;strong&gt;MCP server&lt;/strong&gt; to clients like &lt;strong&gt;Claude Desktop&lt;/strong&gt; to expose on-demand conversions to chats.&lt;/li&gt;
&lt;li&gt;MarkItDown can integrate with LLMs to generate &lt;strong&gt;image descriptions&lt;/strong&gt; and extract text from images with &lt;strong&gt;OCR&lt;/strong&gt; and &lt;strong&gt;custom prompts&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To decide whether to use MarkItDown or another library—such as Pandoc—for your Markdown conversion tasks, consider these factors:&lt;/p&gt;
&lt;div class=&quot;table-responsive&quot;&gt;
&lt;table class=&quot;table table-hover&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Use Case&lt;/th&gt;
&lt;th class=&quot;text-center&quot;&gt;Choose MarkItDown&lt;/th&gt;
&lt;th class=&quot;text-center&quot;&gt;Choose Pandoc&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;You want fast Markdown conversion for documentation, blogs, or LLM input.&lt;/td&gt;
&lt;td class=&quot;text-center&quot;&gt;✅&lt;/td&gt;
&lt;td class=&quot;text-center&quot;&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;You need high visual fidelity, fine-grained layout control, or broader input/output format support.&lt;/td&gt;
&lt;td class=&quot;text-center&quot;&gt;—&lt;/td&gt;
&lt;td class=&quot;text-center&quot;&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;Your choice depends on whether you value speed, structure, and AI-pipeline integration over full formatting fidelity or wide-format support. MarkItDown isn’t intended for perfect, high-fidelity conversions for human consumption. This is especially true for complex document layouts or richly formatted content, in which case you should use Pandoc.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-markitdown-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-markitdown-code&quot; markdown&gt;Click here to download the free sample code&lt;/a&gt; that shows you how to use Python MarkItDown to convert documents into LLM-ready Markdown.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;container border rounded text-wrap-pretty my-3&quot;&gt;

  &lt;p class=&quot;my-3&quot;&gt;&lt;mark class=&quot;marker-highlight&quot;&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt;&lt;/mark&gt; Test your knowledge with our interactive “Python MarkItDown: Convert Documents Into LLM-Ready Markdown” quiz. You’ll receive a score upon completion to help you track your learning progress:&lt;/p&gt;

  &lt;hr&gt;

  &lt;div class=&quot;row my-3&quot;&gt;
    &lt;div class=&quot;col-xs-12 col-sm-4 col-md-3 align-self-center&quot;&gt;

      &lt;a href=&quot;/quizzes/python-markitdown/&quot; tabindex=&quot;-1&quot;&gt;
        &lt;div class=&quot;embed-responsive embed-responsive-16by9&quot;&gt;

            &lt;img class=&quot;card-img-top m-0 p-0 embed-responsive-item rounded&quot; style=&quot;object-fit: contain; background: #b9abe6;&quot; alt=&quot;Python MarkItDown: Convert Documents Into LLM-Ready Markdown&quot; src=&quot;https://files.realpython.com/media/MarkItDown-Convert-Anything-to-Markdown-to-Feed-to-Your-LLM_Watermarked.201792042d8c.jpg&quot; width=&quot;1920&quot; height=&quot;1080&quot; srcset=&quot;/cdn-cgi/image/width=480,format=auto/https://files.realpython.com/media/MarkItDown-Convert-Anything-to-Markdown-to-Feed-to-Your-LLM_Watermarked.201792042d8c.jpg 480w, /cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/MarkItDown-Convert-Anything-to-Markdown-to-Feed-to-Your-LLM_Watermarked.201792042d8c.jpg 640w, /cdn-cgi/image/width=960,format=auto/https://files.realpython.com/media/MarkItDown-Convert-Anything-to-Markdown-to-Feed-to-Your-LLM_Watermarked.201792042d8c.jpg 960w, /cdn-cgi/image/width=1920,format=auto/https://files.realpython.com/media/MarkItDown-Convert-Anything-to-Markdown-to-Feed-to-Your-LLM_Watermarked.201792042d8c.jpg 1920w&quot; sizes=&quot;(min-width: 1200px) 142px, (min-width: 1000px) 122px, (min-width: 780px) 112px, (min-width: 580px) 139px, calc(100vw - 62px)&quot;&gt;


          &lt;div class=&quot;card-img-overlay d-flex align-items-center&quot;&gt;
            &lt;div class=&quot;mx-auto&quot;&gt;
              &lt;span class=&quot;text-light&quot; style=&quot;opacity: 0.90;&quot;&gt;&lt;span class=&quot;icon baseline scale2x&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/a&gt;

    &lt;/div&gt;
    &lt;div class=&quot;col&quot;&gt;
      &lt;div class=&quot;mt-3 d-md-none&quot;&gt;&lt;/div&gt; 
      &lt;p class=&quot;small text-muted mb-0&quot;&gt;&lt;strong&gt;Interactive Quiz&lt;/strong&gt;&lt;/p&gt;
      &lt;a href=&quot;/quizzes/python-markitdown/&quot; class=&quot;stretched-link&quot;&gt;&lt;span class=&quot;my-0 h4&quot;&gt;Python MarkItDown: Convert Documents Into LLM-Ready Markdown&lt;/span&gt;&lt;/a&gt; 
      &lt;p class=&quot;text-muted mb-0 small&quot;&gt;Practice MarkItDown basics. Convert PDFs, Word documents, Excel documents, and HTML documents to Markdown. Try the quiz.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;/div&gt;

&lt;h2 id=&quot;start-using-markitdown&quot;&gt;Start Using MarkItDown&lt;a class=&quot;headerlink&quot; href=&quot;#start-using-markitdown&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/microsoft/markitdown&quot;&gt;MarkItDown&lt;/a&gt; is a lightweight Python utility for converting various file formats into &lt;a href=&quot;https://daringfireball.net/projects/markdown/&quot;&gt;Markdown&lt;/a&gt; content. This tool is useful when you need to feed &lt;a href=&quot;/ref/ai-coding-glossary/llm/&quot; class=&quot;ref-link&quot;&gt;large language models (LLMs)&lt;/a&gt; and AI-powered text analysis pipelines with specific content that’s stored in other file formats. This lets you take advantage of Markdown’s high token efficiency.&lt;/p&gt;
&lt;p&gt;The library supports a wide list of input formats, including the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;PDF&lt;/li&gt;
&lt;li&gt;PowerPoint&lt;/li&gt;
&lt;li&gt;Word&lt;/li&gt;
&lt;li&gt;Excel&lt;/li&gt;
&lt;li&gt;Images&lt;/li&gt;
&lt;li&gt;HTML&lt;/li&gt;
&lt;li&gt;Text-based formats (&lt;a href=&quot;https://realpython.com/python-csv/&quot;&gt;CSV&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-json/&quot;&gt;JSON&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-xml-parser/&quot;&gt;XML&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The relevance of MarkItDown lies in its minimal setup and its ability to handle multiple input file formats. In the following sections, you’ll learn how to install and set up MarkItDown in your Python &lt;a href=&quot;/ref/glossary/virtual-environment/&quot; class=&quot;ref-link&quot;&gt;environment&lt;/a&gt; and explore its &lt;a href=&quot;https://realpython.com/command-line-interfaces-python-argparse/&quot;&gt;command-line interface (CLI)&lt;/a&gt; and main features.&lt;/p&gt;
&lt;h3 id=&quot;installation&quot;&gt;Installation&lt;a class=&quot;headerlink&quot; href=&quot;#installation&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;To get started with MarkItDown, you need to install the library from the &lt;a href=&quot;/ref/glossary/pypi/&quot; class=&quot;ref-link&quot;&gt;Python Package Index (PyPI)&lt;/a&gt; using &lt;a href=&quot;https://realpython.com/what-is-pip/&quot;&gt;&lt;code&gt;pip&lt;/code&gt;&lt;/a&gt;. Before running the command below, make sure you create and activate a Python &lt;a href=&quot;https://realpython.com/python-virtual-environments-a-primer/&quot;&gt;virtual environment&lt;/a&gt; to avoid cluttering your system Python installation:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;-m&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;pip&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;install&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#x27;markitdown[all]&#x27;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;This command installs MarkItDown and all its optional dependencies in your current Python environment. After the installation finishes, you can verify that the package is working correctly:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;markitdown&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;--version
&lt;span class=&quot;go&quot;&gt;markitdown 0.1.3&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;This command should display the installed version of MarkItDown, confirming a successful installation. That should be it! You’re all set up to start using the library.&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’re running the latest &lt;a href=&quot;https://realpython.com/python314-new-features/&quot;&gt;Python 3.14&lt;/a&gt; release, &lt;code&gt;pip&lt;/code&gt; might install an outdated version of MarkItDown instead of the current stable one. This happens because the library’s own dependencies haven’t been built for Python 3.14 yet, so &lt;code&gt;pip&lt;/code&gt; falls back to the earliest compatible version it finds.&lt;/p&gt;
&lt;p&gt;To fix this, you can install MarkItDown in a &lt;a href=&quot;https://realpython.com/python313-new-features/&quot;&gt;Python 3.13&lt;/a&gt; or earlier environment. Check out &lt;a href=&quot;https://realpython.com/intro-to-pyenv/&quot;&gt;pyenv&lt;/a&gt; to manage multiple versions of Python.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Alternatively, MarkItDown also supports several optional dependencies that enhance its capabilities. You can install them selectively according to your needs. Below is a list of some available optional dependencies:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;pptx&lt;/code&gt;&lt;/strong&gt; for PowerPoint files&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;docx&lt;/code&gt;&lt;/strong&gt; for Word documents&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;xlsx&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;xls&lt;/code&gt;&lt;/strong&gt; for modern and older &lt;a href=&quot;https://realpython.com/openpyxl-excel-spreadsheets-python/&quot;&gt;Excel&lt;/a&gt; workbooks&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;pdf&lt;/code&gt;&lt;/strong&gt; for &lt;a href=&quot;https://realpython.com/creating-modifying-pdf/&quot;&gt;PDF&lt;/a&gt; files&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;outlook&lt;/code&gt;&lt;/strong&gt; for Outlook messages&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;az-doc-intel&lt;/code&gt;&lt;/strong&gt; for Azure Document Intelligence&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;audio-transcription&lt;/code&gt;&lt;/strong&gt; for audio transcription of &lt;a href=&quot;https://realpython.com/python-wav-files/&quot;&gt;WAV&lt;/a&gt; and MP3 files&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;youtube-transcription&lt;/code&gt;&lt;/strong&gt; for fetching YouTube video transcripts&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you only need a subset of dependencies, then you can install them with a command like the following:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;-m&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;pip&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;install&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#x27;markitdown[pdf,pptx,docx]&#x27;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;This command installs only the dependencies needed for processing PDF, PPTX, and DOCX files. This way, you avoid cluttering your environment with artifacts that you won’t use or need in your code.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-markitdown/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-markitdown/ »&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>Quiz: Python MarkItDown: Convert Documents Into LLM-Ready Markdown</title>
      <id>https://realpython.com/quizzes/python-markitdown/</id>
      <link href="https://realpython.com/quizzes/python-markitdown/"/>
      <updated>2025-11-05T12:00:00+00:00</updated>
      <summary>Practice MarkItDown basics. Convert PDFs, Word documents, Excel documents, and HTML documents to Markdown. Try the quiz.</summary>
      <content type="html">
        &lt;p&gt;In this quiz, you&amp;rsquo;ll test your understanding of the &lt;a href=&quot;https://realpython.com/python-markitdown/&quot;&gt;Python MarkItDown: Convert Documents Into LLM-Ready Markdown&lt;/a&gt; tutorial.&lt;/p&gt;
&lt;p&gt;By working through this quiz, you&amp;rsquo;ll revisit how to install MarkItDown, convert documents to Markdown for your LLM workflows, and more.&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>Building UIs in the Terminal With Python Textual</title>
      <id>https://realpython.com/courses/building-uis-terminal-python-textual/</id>
      <link href="https://realpython.com/courses/building-uis-terminal-python-textual/"/>
      <updated>2025-11-04T14:00:00+00:00</updated>
      <summary>Learn to build rich, interactive terminal UIs in Python with Textual: a powerful library for modern, event-driven TUIs.</summary>
      <content type="html">
        &lt;p&gt;Have you ever wanted to create an app with an appealing interface that works in the command line? Welcome to Textual, a Python toolkit and framework for creating beautiful, functional &lt;strong&gt;text-based user interface (TUI)&lt;/strong&gt; applications. The Textual library provides a powerful and flexible framework for building TUIs. It offers a variety of features that allow you to create interactive and engaging console applications.&lt;/p&gt;
&lt;p&gt;In this video course, you&amp;rsquo;ll learn how to create, style, and enhance Textual apps with layouts, events, and actions.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this video course, you&amp;rsquo;ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Python Textual&lt;/strong&gt; is a framework for building terminal-based applications with interactive and visually appealing text interfaces.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Textual works&lt;/strong&gt; by providing a set of widgets, layouts, and styling options, enabling you to create responsive and interactive console apps.&lt;/li&gt;
&lt;li&gt;Textual is useful for building efficient, &lt;strong&gt;platform-independent text-based user interfaces&lt;/strong&gt; that work over remote connections and in low-resource environments.&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>A Close Look at a FastAPI Example Application</title>
      <id>https://realpython.com/fastapi-python-web-apis/</id>
      <link href="https://realpython.com/fastapi-python-web-apis/"/>
      <updated>2025-11-03T14:00:00+00:00</updated>
      <summary>Set up an example FastAPI app, add path and query parameters, and handle CRUD operations with Pydantic for clean, validated endpoints.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;This example project showcases important features of the FastAPI web framework, including automatic validation and documentation. FastAPI is an excellent choice for both beginners building their first API and experienced developers diving deep into API design.&lt;/p&gt;
&lt;p&gt;In this tutorial, you’ll explore a &lt;strong&gt;FastAPI example application&lt;/strong&gt; by building a randomizer API that can shuffle lists, pick random items, and generate random numbers.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this tutorial, you’ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Path parameters and type hints&lt;/strong&gt; work together for automatic request validation.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Request bodies&lt;/strong&gt; handle complex data in your API endpoints.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Asynchronous programming&lt;/strong&gt; improves your API’s performance.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CORS configuration&lt;/strong&gt; enables secure cross-origin requests.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To follow along with this tutorial, you should be comfortable &lt;a href=&quot;https://realpython.com/defining-your-own-python-function/&quot;&gt;defining Python functions&lt;/a&gt;, working with &lt;a href=&quot;https://realpython.com/primer-on-python-decorators/&quot;&gt;decorators&lt;/a&gt;, and have a basic understanding of &lt;a href=&quot;https://realpython.com/crud-operations/&quot;&gt;CRUD&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/python-json/&quot;&gt;JSON&lt;/a&gt;.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-web-apis-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-web-apis-code&quot; markdown&gt;Click here to download the free sample code&lt;/a&gt; that you’ll use to take a close look at a FastAPI example application.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;container border rounded text-wrap-pretty my-3&quot;&gt;

  &lt;p class=&quot;my-3&quot;&gt;&lt;mark class=&quot;marker-highlight&quot;&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt;&lt;/mark&gt; Test your knowledge with our interactive “A Close Look at a FastAPI Example Application” quiz. You’ll receive a score upon completion to help you track your learning progress:&lt;/p&gt;

  &lt;hr&gt;

  &lt;div class=&quot;row my-3&quot;&gt;
    &lt;div class=&quot;col-xs-12 col-sm-4 col-md-3 align-self-center&quot;&gt;

      &lt;a href=&quot;/quizzes/fastapi-python-web-apis/&quot; tabindex=&quot;-1&quot;&gt;
        &lt;div class=&quot;embed-responsive embed-responsive-16by9&quot;&gt;

            &lt;img class=&quot;card-img-top m-0 p-0 embed-responsive-item rounded&quot; style=&quot;object-fit: contain; background: #fe7e73;&quot; alt=&quot;A Close Look at a FastAPI Example Application&quot; src=&quot;https://files.realpython.com/media/FastAPI-Example-Application.9a5baa46c84b.jpg&quot; width=&quot;1920&quot; height=&quot;1080&quot; srcset=&quot;/cdn-cgi/image/width=480,format=auto/https://files.realpython.com/media/FastAPI-Example-Application.9a5baa46c84b.jpg 480w, /cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/FastAPI-Example-Application.9a5baa46c84b.jpg 640w, /cdn-cgi/image/width=960,format=auto/https://files.realpython.com/media/FastAPI-Example-Application.9a5baa46c84b.jpg 960w, /cdn-cgi/image/width=1920,format=auto/https://files.realpython.com/media/FastAPI-Example-Application.9a5baa46c84b.jpg 1920w&quot; sizes=&quot;(min-width: 1200px) 142px, (min-width: 1000px) 122px, (min-width: 780px) 112px, (min-width: 580px) 139px, calc(100vw - 62px)&quot;&gt;


          &lt;div class=&quot;card-img-overlay d-flex align-items-center&quot;&gt;
            &lt;div class=&quot;mx-auto&quot;&gt;
              &lt;span class=&quot;text-light&quot; style=&quot;opacity: 0.90;&quot;&gt;&lt;span class=&quot;icon baseline scale2x&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/a&gt;

    &lt;/div&gt;
    &lt;div class=&quot;col&quot;&gt;
      &lt;div class=&quot;mt-3 d-md-none&quot;&gt;&lt;/div&gt; 
      &lt;p class=&quot;small text-muted mb-0&quot;&gt;&lt;strong&gt;Interactive Quiz&lt;/strong&gt;&lt;/p&gt;
      &lt;a href=&quot;/quizzes/fastapi-python-web-apis/&quot; class=&quot;stretched-link&quot;&gt;&lt;span class=&quot;my-0 h4&quot;&gt;A Close Look at a FastAPI Example Application&lt;/span&gt;&lt;/a&gt; 
      &lt;p class=&quot;text-muted mb-0 small&quot;&gt;Practice FastAPI basics with path parameters, request bodies, async endpoints, and CORS. Build confidence to design and test simple Python web APIs.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;/div&gt;

&lt;h2 id=&quot;set-up-a-fastapi-example-project&quot;&gt;Set Up a FastAPI Example Project&lt;a class=&quot;headerlink&quot; href=&quot;#set-up-a-fastapi-example-project&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Before diving into code, you’ll need to properly set up your development environment. This involves installing &lt;a href=&quot;https://fastapi.tiangolo.com&quot;&gt;FastAPI&lt;/a&gt; and creating your first &lt;a href=&quot;https://en.wikipedia.org/wiki/Web_API#Endpoints&quot;&gt;endpoint&lt;/a&gt;. The goal of these first lines of code is to verify that everything works correctly.&lt;/p&gt;
&lt;h3 id=&quot;install-fastapi&quot;&gt;Install FastAPI&lt;a class=&quot;headerlink&quot; href=&quot;#install-fastapi&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;FastAPI requires two main components to run your application: the &lt;strong&gt;framework&lt;/strong&gt; itself and an &lt;strong&gt;ASGI (Asynchronous Server Gateway Interface) server&lt;/strong&gt;. The recommended way to install FastAPI includes these two components and all the standard dependencies you’ll need to get started with your FastAPI project.&lt;/p&gt;
&lt;p&gt;First, select your &lt;strong&gt;operating system&lt;/strong&gt; below and use your platform-specific command to set up a &lt;a href=&quot;/ref/glossary/virtual-environment/&quot; class=&quot;ref-link&quot;&gt;virtual environment&lt;/a&gt;:&lt;/p&gt;
&lt;ul class=&quot;nav nav-tabs justify-content-end js-platform-widget-tabs&quot; role=&quot;tablist&quot;&gt;

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




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

&lt;/ul&gt;
&lt;div class=&quot;tab-content mt-2 mb-0 js-platform-widget-content&quot;&gt;
&lt;div aria-labelledby=&quot;windows-tab-1&quot; class=&quot;tab-pane fade show active&quot; id=&quot;windows-1&quot; role=&quot;tabpanel&quot;&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pscon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Windows PowerShell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;PS&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;python&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;-m&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;venv&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;venv&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;PS&amp;gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.\&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;venv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Scripts&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;activate&lt;/span&gt;
&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;PS&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;/div&gt;
&lt;div aria-labelledby=&quot;linux-macos-tab-1&quot; class=&quot;tab-pane fade &quot; id=&quot;linux-macos-1&quot; role=&quot;tabpanel&quot;&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;-m&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;venv&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;venv
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;source&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;venv/bin/activate
&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;With your virtual environment activated, install FastAPI with all its standard dependencies:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;-m&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;pip&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;install&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;fastapi[standard]&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;This command installs FastAPI along with &lt;a href=&quot;https://www.uvicorn.org/&quot;&gt;Uvicorn&lt;/a&gt; as the ASGI server. The &lt;code&gt;[standard]&lt;/code&gt; extra includes a predefined set of optional dependencies that enhance FastAPI’s functionality. For example, it provides the &lt;a href=&quot;https://fastapi.tiangolo.com/fastapi-cli/&quot;&gt;FastAPI CLI&lt;/a&gt;, which you’ll use later to run the development server.&lt;/p&gt;
&lt;h3 id=&quot;create-your-first-api-endpoint&quot;&gt;Create Your First API Endpoint&lt;a class=&quot;headerlink&quot; href=&quot;#create-your-first-api-endpoint&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;With FastAPI installed, you can create a minimal API with one &lt;strong&gt;API endpoint&lt;/strong&gt; to test your setup. This first endpoint will help you understand the basic structure of a FastAPI application. You’ll see how FastAPI uses Python &lt;a href=&quot;/ref/glossary/decorator/&quot; class=&quot;ref-link&quot;&gt;decorators&lt;/a&gt; to define routes and how it automatically handles JSON serialization for your response data.&lt;/p&gt;
&lt;p&gt;Start by creating a new file named &lt;code&gt;main.py&lt;/code&gt; in your project’s directory:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;python&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    &lt;span class=&quot;mr-2&quot; aria-label=&quot;Filename&quot;&gt;&lt;code style=&quot;color: inherit; background: inherit;&quot;&gt;main.py&lt;/code&gt;&lt;/span&gt;
    &lt;div class=&quot;noselect&quot;&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nn&quot;&gt;fastapi&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;FastAPI&lt;/span&gt;

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

&lt;span class=&quot;nd&quot;&gt;@app&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;/&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;home&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;():&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;message&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Welcome to the Randomizer API&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;You create your FastAPI application named &lt;code&gt;app&lt;/code&gt; by instantiating the &lt;code&gt;FastAPI&lt;/code&gt; class. The &lt;code&gt;@app.get(&quot;/&quot;)&lt;/code&gt; decorator defines the &lt;code&gt;home()&lt;/code&gt; function as a route handler. That way, FastAPI will call the &lt;code&gt;home()&lt;/code&gt; function when someone sends a &lt;a href=&quot;https://realpython.com/api-integration-in-python/#get&quot;&gt;GET&lt;/a&gt; request to your API’s root URL.&lt;/p&gt;
&lt;p&gt;To see what this looks like in action, hop over to the terminal and run your FastAPI application with the following command:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;fastapi&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;dev&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;main.py

&lt;span class=&quot;go&quot;&gt;FastAPI  Starting development server 🚀&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;         Searching for package file structure from directories with __init__.py files&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;         Importing from /Users/rp/projects/fastapi&lt;/span&gt;

&lt;span class=&quot;go&quot;&gt;module   🐍 main.py&lt;/span&gt;

&lt;span class=&quot;go&quot;&gt;  code   Importing the FastAPI app object from the module with the following code:&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;         from main import app&lt;/span&gt;

&lt;span class=&quot;go&quot;&gt;   app   Using import string: main:app&lt;/span&gt;

&lt;span class=&quot;go&quot;&gt;server   Server started at http://127.0.0.1:8000&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;server   Documentation at http://127.0.0.1:8000/docs&lt;/span&gt;

&lt;span class=&quot;go&quot;&gt;   tip   Running in development mode, for production use: fastapi run&lt;/span&gt;

&lt;span class=&quot;go&quot;&gt;         Logs:&lt;/span&gt;

&lt;span class=&quot;go&quot;&gt;  INFO   Will watch for changes in these directories: [&#x27;/Users/rp/projects/fastapi&#x27;]&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  INFO   Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  INFO   Started reloader process [85470] using WatchFiles&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  INFO   Started server process [85474]&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  INFO   Waiting for application startup.&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  INFO   Application startup complete.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;The &lt;code&gt;fastapi dev&lt;/code&gt; command is part of the FastAPI CLI. It starts your application in &lt;strong&gt;development mode&lt;/strong&gt; with automatic reloading. This means that any changes you make to your code will automatically restart the server.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/fastapi-python-web-apis/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/fastapi-python-web-apis/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Quiz: A Close Look at a FastAPI Example Application</title>
      <id>https://realpython.com/quizzes/fastapi-python-web-apis/</id>
      <link href="https://realpython.com/quizzes/fastapi-python-web-apis/"/>
      <updated>2025-11-03T12:00:00+00:00</updated>
      <summary>Practice FastAPI basics with path parameters, request bodies, async endpoints, and CORS. Build confidence to design and test simple Python web APIs.</summary>
      <content type="html">
        &lt;p&gt;In this quiz, you&amp;rsquo;ll test your understanding of the FastAPI example project that can shuffle lists, pick random items, and generate random numbers.&lt;/p&gt;
&lt;p&gt;By working through this quiz, you&amp;rsquo;ll revisit how path parameters and type hints enable automatic validation, how request bodies model data, how async endpoints improve performance, and how CORS allows safe cross-origin requests.&lt;/p&gt;
&lt;p&gt;To go deeper, read &lt;a href=&quot;https://realpython.com/fastapi-python-web-apis/&quot;&gt;A Close Look at a FastAPI Example Application&lt;/a&gt;. You can also review &lt;a href=&quot;https://realpython.com/defining-your-own-python-function/&quot;&gt;Python functions&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/primer-on-python-decorators/&quot;&gt;decorators&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/crud-operations/&quot;&gt;CRUD&lt;/a&gt;, and &lt;a href=&quot;https://realpython.com/python-json/&quot;&gt;JSON&lt;/a&gt;.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #272: Michael Kennedy: Managing Your Own Python Infrastructure</title>
      <id>https://realpython.com/podcasts/rpp/272/</id>
      <link href="https://realpython.com/podcasts/rpp/272/"/>
      <updated>2025-10-31T12:00:00+00:00</updated>
      <summary>How do you deploy your Python application without getting locked into an expensive cloud-based service? This week on the show, Michael Kennedy from the Talk Python podcast returns to discuss his new book, &quot;Talk Python in Production.&quot;</summary>
      <content type="html">
        &lt;p&gt;How do you deploy your Python application without getting locked into an expensive cloud-based service? This week on the show, Michael Kennedy from the Talk Python podcast returns to discuss his new book, &quot;Talk Python in Production.&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>Logging in Python</title>
      <id>https://realpython.com/python-logging/</id>
      <link href="https://realpython.com/python-logging/"/>
      <updated>2025-10-29T14:00:00+00:00</updated>
      <summary>If you use Python&#x27;s print() function to get information about the flow of your programs, logging is the natural next step. Create your first logs and curate them to grow with your projects.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Logging in Python lets you record important information about your program’s execution. You use the built-in &lt;code&gt;logging&lt;/code&gt; module to capture logs, which provide insights into application flow, errors, and usage patterns. With Python logging, you can create and configure loggers, set log levels, and format log messages without installing additional packages. You can also generate log files to store records for later analysis.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this tutorial, you’ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Logging&lt;/strong&gt; involves recording program execution information for later analysis.&lt;/li&gt;
&lt;li&gt;You can use logging to &lt;strong&gt;debug&lt;/strong&gt;, &lt;strong&gt;perform analysis&lt;/strong&gt;, and &lt;strong&gt;monitor usage patterns&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Logging in Python works by &lt;strong&gt;configuring loggers&lt;/strong&gt; and &lt;strong&gt;setting log levels&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Using a &lt;strong&gt;logging library&lt;/strong&gt; provides &lt;strong&gt;structured logging&lt;/strong&gt; and control over log output.&lt;/li&gt;
&lt;li&gt;You should &lt;strong&gt;prefer logging over &lt;code&gt;print()&lt;/code&gt;&lt;/strong&gt; because it &lt;strong&gt;decreases the maintenance burden&lt;/strong&gt; and allows you to manage log levels.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You’ll do the coding for this tutorial in the &lt;a href=&quot;https://realpython.com/python-repl/&quot;&gt;Python standard REPL&lt;/a&gt;. If you prefer Python files, then you’ll find a full logging example as a script in the materials of this tutorial. You can download this script by clicking the link below:&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-logging-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-logging-code&quot; markdown&gt;Click here to download the free sample code&lt;/a&gt; that you’ll use to learn about logging in Python.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;container border rounded text-wrap-pretty my-3&quot;&gt;

  &lt;p class=&quot;my-3&quot;&gt;&lt;mark class=&quot;marker-highlight&quot;&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt;&lt;/mark&gt; Test your knowledge with our interactive “Logging in Python” quiz. You’ll receive a score upon completion to help you track your learning progress:&lt;/p&gt;

  &lt;hr&gt;

  &lt;div class=&quot;row my-3&quot;&gt;
    &lt;div class=&quot;col-xs-12 col-sm-4 col-md-3 align-self-center&quot;&gt;

      &lt;a href=&quot;/quizzes/logging-in-python/&quot; tabindex=&quot;-1&quot;&gt;
        &lt;div class=&quot;embed-responsive embed-responsive-16by9&quot;&gt;

            &lt;img class=&quot;card-img-top m-0 p-0 embed-responsive-item rounded&quot; style=&quot;object-fit: contain; background: #e6c7ab;&quot; alt=&quot;Logging in Python&quot; src=&quot;https://files.realpython.com/media/Logging-in-Python_Watermarked.4ca8974dc55c.jpg&quot; width=&quot;1920&quot; height=&quot;1080&quot; srcset=&quot;/cdn-cgi/image/width=480,format=auto/https://files.realpython.com/media/Logging-in-Python_Watermarked.4ca8974dc55c.jpg 480w, /cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/Logging-in-Python_Watermarked.4ca8974dc55c.jpg 640w, /cdn-cgi/image/width=960,format=auto/https://files.realpython.com/media/Logging-in-Python_Watermarked.4ca8974dc55c.jpg 960w, /cdn-cgi/image/width=1920,format=auto/https://files.realpython.com/media/Logging-in-Python_Watermarked.4ca8974dc55c.jpg 1920w&quot; sizes=&quot;(min-width: 1200px) 142px, (min-width: 1000px) 122px, (min-width: 780px) 112px, (min-width: 580px) 139px, calc(100vw - 62px)&quot;&gt;


          &lt;div class=&quot;card-img-overlay d-flex align-items-center&quot;&gt;
            &lt;div class=&quot;mx-auto&quot;&gt;
              &lt;span class=&quot;text-light&quot; style=&quot;opacity: 0.90;&quot;&gt;&lt;span class=&quot;icon baseline scale2x&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/a&gt;

    &lt;/div&gt;
    &lt;div class=&quot;col&quot;&gt;
      &lt;div class=&quot;mt-3 d-md-none&quot;&gt;&lt;/div&gt; 
      &lt;p class=&quot;small text-muted mb-0&quot;&gt;&lt;strong&gt;Interactive Quiz&lt;/strong&gt;&lt;/p&gt;
      &lt;a href=&quot;/quizzes/logging-in-python/&quot; class=&quot;stretched-link&quot;&gt;&lt;span class=&quot;my-0 h4&quot;&gt;Logging in Python&lt;/span&gt;&lt;/a&gt; 
      &lt;p class=&quot;text-muted mb-0 small&quot;&gt;In this quiz, you&#x27;ll test your understanding of Python&#x27;s logging module. With this knowledge, you&#x27;ll be able to add logging to your applications, which can help you debug errors and analyze performance.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;/div&gt;

&lt;p&gt;If you’re curious about an alternative to Python’s built-in &lt;code&gt;logging&lt;/code&gt; module, then check out &lt;a href=&quot;https://realpython.com/python-loguru/&quot;&gt;How to Use Loguru for Simpler Python Logging&lt;/a&gt;. While the standard library’s logging requires explicit configuration of handlers, formatters, and log levels, Loguru comes pre-configured after installing it with &lt;a href=&quot;/ref/glossary/pip/&quot; class=&quot;ref-link&quot;&gt;pip&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;starting-with-pythons-logging-module&quot;&gt;Starting With Python’s Logging Module&lt;a class=&quot;headerlink&quot; href=&quot;#starting-with-pythons-logging-module&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The &lt;a href=&quot;https://docs.python.org/3/library/logging.html#module-logging/&quot;&gt;&lt;code&gt;logging&lt;/code&gt; module&lt;/a&gt; in Python’s &lt;a href=&quot;/ref/glossary/standard-library/&quot; class=&quot;ref-link&quot;&gt;standard library&lt;/a&gt; is a ready-to-use, powerful module that’s designed to meet the needs of beginners as well as enterprise teams.&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; Since logs offer a variety of insights, the &lt;code&gt;logging&lt;/code&gt; module is often used by other third-party Python libraries, too. Once you’re more advanced in the practice of logging, you can integrate your log messages with the ones from those libraries to produce a homogeneous log for your application.&lt;/p&gt;
&lt;p&gt;To leverage this versatility, it’s a good idea to get a better understanding of how the &lt;code&gt;logging&lt;/code&gt; module works under the hood. For example, you could take &lt;a href=&quot;https://realpython.com/python-logging-source-code/&quot;&gt;a stroll through the &lt;code&gt;logging&lt;/code&gt; module’s source code&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;The main component of the &lt;code&gt;logging&lt;/code&gt; module is something called the &lt;strong&gt;logger&lt;/strong&gt;. You can think of the logger as a reporter in your code that decides what to record, at what level of detail, and where to store or send these records.&lt;/p&gt;
&lt;h3 id=&quot;exploring-the-root-logger&quot;&gt;Exploring the Root Logger&lt;a class=&quot;headerlink&quot; href=&quot;#exploring-the-root-logger&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;To get a first impression of how the &lt;code&gt;logging&lt;/code&gt; module and a logger work, open the &lt;a href=&quot;https://realpython.com/python-repl/&quot;&gt;Python standard REPL&lt;/a&gt; and enter the code below:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nn&quot;&gt;logging&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;logging&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;warning&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Remain calm!&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;WARNING:root:Remain calm!&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;The output shows the severity level before each message along with &lt;code&gt;root&lt;/code&gt;, which is the name the &lt;code&gt;logging&lt;/code&gt; module gives to its default logger. This output shows the default format that can be configured to include things like a timestamp or other details.&lt;/p&gt;
&lt;p&gt;In the example above, you’re sending a message on the &lt;code&gt;root&lt;/code&gt; logger. The &lt;strong&gt;log level&lt;/strong&gt; of the message is &lt;code&gt;WARNING&lt;/code&gt;. Log levels are an important aspect of logging. By default, there are five &lt;a href=&quot;https://docs.python.org/3/library/logging.html#logging-levels&quot;&gt;standard severity levels&lt;/a&gt; for logging events. Each has a corresponding &lt;a href=&quot;/ref/glossary/function/&quot; class=&quot;ref-link&quot;&gt;function&lt;/a&gt; that can be used to log events at that level of severity. &lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; There’s also a &lt;code&gt;NOTSET&lt;/code&gt; log level, which you’ll encounter later in this tutorial when you learn about custom logging handlers.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Here are the five default log levels, in order of increasing severity:&lt;/p&gt;
&lt;div class=&quot;table-responsive&quot;&gt;
&lt;table class=&quot;table table-hover&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Log Level&lt;/th&gt;
&lt;th&gt;Function&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEBUG&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;logging.debug()&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Provides detailed information that’s valuable to you as a developer.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;INFO&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;logging.info()&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Provides general information about what’s going on with your program.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;WARNING&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;logging.warning()&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Indicates that there’s something you should look into.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ERROR&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;logging.error()&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Alerts you to an unexpected problem that’s occurred in your program.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;CRITICAL&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;logging.critical()&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Tells you that a serious error has occurred and may have crashed your app.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;The &lt;code&gt;logging&lt;/code&gt; module provides you with a default logger that allows you to get started with logging without needing to do much configuration. However, the &lt;code&gt;logging&lt;/code&gt; functions listed in the table above reveal a quirk that you may not expect:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;logging&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;debug&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;This is a debug message&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;logging&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;info&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;This is an info message&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;logging&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;warning&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;This is a warning message&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;WARNING:root:This is a warning message&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;logging&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;This is an error message&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;ERROR:root:This is an error message&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;logging&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;critical&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;This is a critical message&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;CRITICAL:root:This is a critical message&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;Notice that the &lt;code&gt;debug()&lt;/code&gt; and &lt;code&gt;info()&lt;/code&gt; messages didn’t get logged. This is because, by default, the logging module logs the messages with a severity level of &lt;code&gt;WARNING&lt;/code&gt; or above. You can change that by configuring the logging module to log events of all levels. &lt;/p&gt;
&lt;h3 id=&quot;adjusting-the-log-level&quot;&gt;Adjusting the Log Level&lt;a class=&quot;headerlink&quot; href=&quot;#adjusting-the-log-level&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;To set up your basic logging configuration and adjust the log level, the &lt;code&gt;logging&lt;/code&gt; module comes with a &lt;a href=&quot;https://docs.python.org/3/library/logging.html#logging.basicConfig&quot;&gt;&lt;code&gt;basicConfig()&lt;/code&gt;&lt;/a&gt; function. As a Python developer, this &lt;a href=&quot;https://en.wikipedia.org/wiki/Camel_case&quot;&gt;camel-cased&lt;/a&gt; function name may look unusual to you, as it doesn’t follow the &lt;a href=&quot;https://realpython.com/python-pep8/#naming-conventions&quot;&gt;PEP 8 naming conventions&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;That’s because it was adopted from &lt;a href=&quot;https://en.wikipedia.org/wiki/Log4j&quot;&gt;Log4j&lt;/a&gt;, a logging utility in &lt;a href=&quot;https://realpython.com/java-vs-python/&quot;&gt;Java&lt;/a&gt;. It’s a known issue in the package, but by the time it was decided to add it to the standard library, it had already been adopted by users, and changing it to meet PEP 8 requirements would cause backwards compatibility issues.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-logging/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-logging/ »&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>Speed Up Python With Concurrency</title>
      <id>https://realpython.com/courses/speed-python-concurrency/</id>
      <link href="https://realpython.com/courses/speed-python-concurrency/"/>
      <updated>2025-10-28T14:00:00+00:00</updated>
      <summary>Learn what concurrency means in Python and why you might want to use it. You&#x27;ll see a simple, non-concurrent approach and then look into why you&#x27;d want threading, asyncio, or multiprocessing.</summary>
      <content type="html">
        &lt;p&gt;Concurrency is the act of having your computer do multiple things at the same time. If you&amp;rsquo;ve heard a lot of talk about &lt;code&gt;asyncio&lt;/code&gt; &lt;a href=&quot;https://realpython.com/python37-new-features/&quot;&gt;being added to Python&lt;/a&gt; but are curious how it compares to other concurrency methods or are wondering what concurrency is and how it might speed up your program, you&amp;rsquo;ve come to the right place.&lt;/p&gt;
&lt;p&gt;In this course, you&amp;rsquo;ll learn the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How I/O bound programs are effected by latency&lt;/li&gt;
&lt;li&gt;Which concurrent programming patterns to use&lt;/li&gt;
&lt;li&gt;What the differences are between the Python concurrency libraries&lt;/li&gt;
&lt;li&gt;How to write code that uses the &lt;code&gt;threading&lt;/code&gt;, &lt;code&gt;asyncio&lt;/code&gt;, and &lt;code&gt;multiprocessing&lt;/code&gt; libraries&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Sample code was tested using Python 3.13. Since much of the &lt;code&gt;asyncio&lt;/code&gt; library has been in flux since Python 3.4, it&amp;rsquo;s recommended to use at least Python 3.9 for the &lt;code&gt;asyncio&lt;/code&gt; portions of the course.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Using Python Optional Arguments When Defining Functions</title>
      <id>https://realpython.com/python-optional-arguments/</id>
      <link href="https://realpython.com/python-optional-arguments/"/>
      <updated>2025-10-27T14:00:00+00:00</updated>
      <summary>Learn to use Python&#x27;s optional arguments to handle variable inputs. Build flexible functions and avoid common errors when setting defaults.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;You define Python functions with optional arguments to make them flexible and reusable. By assigning default values, using &lt;code&gt;*args&lt;/code&gt; for variable arguments, or &lt;code&gt;**kwargs&lt;/code&gt; for keyword arguments, you let your functions handle different inputs without rewriting code. This tutorial shows you how and why to use Python optional arguments, and how to avoid common pitfalls when setting defaults.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this tutorial, you’ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Parameters&lt;/strong&gt; are names in a function definition, while &lt;strong&gt;arguments&lt;/strong&gt; are the values you pass when calling the function  &lt;/li&gt;
&lt;li&gt;You can assign &lt;strong&gt;default values&lt;/strong&gt; to parameters so that arguments become optional  &lt;/li&gt;
&lt;li&gt;You should avoid &lt;strong&gt;mutable data types&lt;/strong&gt; like lists or dictionaries as default values to prevent unexpected behavior  &lt;/li&gt;
&lt;li&gt;You can use &lt;strong&gt;&lt;code&gt;*args&lt;/code&gt;&lt;/strong&gt; to collect any number of positional arguments and &lt;strong&gt;&lt;code&gt;**kwargs&lt;/code&gt;&lt;/strong&gt; to collect keyword arguments  &lt;/li&gt;
&lt;li&gt;Python raises &lt;strong&gt;&lt;code&gt;TypeError&lt;/code&gt;&lt;/strong&gt; when you omit required arguments and &lt;strong&gt;&lt;code&gt;SyntaxError&lt;/code&gt;&lt;/strong&gt; when you misorder parameters with defaults  &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Defining your own functions is an essential skill for writing clean and effective code. Once you master Python’s optional arguments, you’ll be able to define functions that are more powerful and more flexible.&lt;/p&gt;
&lt;p&gt;To get the most out of this tutorial, you’ll need some familiarity with &lt;a href=&quot;https://realpython.com/defining-your-own-python-function/&quot;&gt;defining functions&lt;/a&gt; with required &lt;a href=&quot;/ref/glossary/argument/&quot; class=&quot;ref-link&quot;&gt;arguments&lt;/a&gt;.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-optional-arguments-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-optional-arguments-code&quot; markdown&gt;Click here to download the free sample code&lt;/a&gt; that you’ll use to learn about the optional arguments in functions.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;container border rounded text-wrap-pretty my-3&quot;&gt;

  &lt;p class=&quot;my-3&quot;&gt;&lt;mark class=&quot;marker-highlight&quot;&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt;&lt;/mark&gt; Test your knowledge with our interactive “Using Python Optional Arguments When Defining Functions” quiz. You’ll receive a score upon completion to help you track your learning progress:&lt;/p&gt;

  &lt;hr&gt;

  &lt;div class=&quot;row my-3&quot;&gt;
    &lt;div class=&quot;col-xs-12 col-sm-4 col-md-3 align-self-center&quot;&gt;

      &lt;a href=&quot;/quizzes/python-optional-arguments/&quot; tabindex=&quot;-1&quot;&gt;
        &lt;div class=&quot;embed-responsive embed-responsive-16by9&quot;&gt;

            &lt;img class=&quot;card-img-top m-0 p-0 embed-responsive-item rounded&quot; style=&quot;object-fit: contain; background: #e5c5ac;&quot; alt=&quot;Using Python Optional Arguments When Defining Functions&quot; src=&quot;https://files.realpython.com/media/How-to-Create-Python-Functions-with-Optional-Arguments_Watermarked.f2c8b582aff0.jpg&quot; width=&quot;1920&quot; height=&quot;1080&quot; srcset=&quot;/cdn-cgi/image/width=480,format=auto/https://files.realpython.com/media/How-to-Create-Python-Functions-with-Optional-Arguments_Watermarked.f2c8b582aff0.jpg 480w, /cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/How-to-Create-Python-Functions-with-Optional-Arguments_Watermarked.f2c8b582aff0.jpg 640w, /cdn-cgi/image/width=960,format=auto/https://files.realpython.com/media/How-to-Create-Python-Functions-with-Optional-Arguments_Watermarked.f2c8b582aff0.jpg 960w, /cdn-cgi/image/width=1920,format=auto/https://files.realpython.com/media/How-to-Create-Python-Functions-with-Optional-Arguments_Watermarked.f2c8b582aff0.jpg 1920w&quot; sizes=&quot;(min-width: 1200px) 142px, (min-width: 1000px) 122px, (min-width: 780px) 112px, (min-width: 580px) 139px, calc(100vw - 62px)&quot;&gt;


          &lt;div class=&quot;card-img-overlay d-flex align-items-center&quot;&gt;
            &lt;div class=&quot;mx-auto&quot;&gt;
              &lt;span class=&quot;text-light&quot; style=&quot;opacity: 0.90;&quot;&gt;&lt;span class=&quot;icon baseline scale2x&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/a&gt;

    &lt;/div&gt;
    &lt;div class=&quot;col&quot;&gt;
      &lt;div class=&quot;mt-3 d-md-none&quot;&gt;&lt;/div&gt; 
      &lt;p class=&quot;small text-muted mb-0&quot;&gt;&lt;strong&gt;Interactive Quiz&lt;/strong&gt;&lt;/p&gt;
      &lt;a href=&quot;/quizzes/python-optional-arguments/&quot; class=&quot;stretched-link&quot;&gt;&lt;span class=&quot;my-0 h4&quot;&gt;Using Python Optional Arguments When Defining Functions&lt;/span&gt;&lt;/a&gt; 
      &lt;p class=&quot;text-muted mb-0 small&quot;&gt;Practice Python function parameters, default values, *args, **kwargs, and safe optional arguments with quick questions and short code tasks.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;/div&gt;

&lt;h2 id=&quot;creating-functions-in-python-for-reusing-code&quot;&gt;Creating Functions in Python for Reusing Code&lt;a class=&quot;headerlink&quot; href=&quot;#creating-functions-in-python-for-reusing-code&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;You can think of a &lt;a href=&quot;/ref/glossary/function/&quot; class=&quot;ref-link&quot;&gt;function&lt;/a&gt; as a mini-program that runs within another program or within another function. The main program calls the mini-program and sends information that the mini-program will need as it runs. When the function completes all of its actions, it may send some data back to the main program that has called it.&lt;/p&gt;
&lt;p&gt;The primary purpose of a function is to allow you to reuse the code within it whenever you need it, using different inputs if required.&lt;/p&gt;
&lt;p&gt;When you use functions, you’re extending your Python vocabulary. This lets you express the solution to your problem in a clearer and more succinct way.&lt;/p&gt;
&lt;p&gt;In Python, by convention, you should name a function using lowercase letters with words separated by an underscore, such as &lt;code&gt;do_something()&lt;/code&gt;. These conventions are described in &lt;a href=&quot;/ref/glossary/pep-8/&quot; class=&quot;ref-link&quot;&gt;PEP 8&lt;/a&gt;, which is Python’s style guide. You’ll need to add parentheses after the function name when you call it. Since functions represent actions, it’s a best practice to start your function names with a verb to make your code more readable.&lt;/p&gt;
&lt;h3 id=&quot;defining-functions-with-no-input-parameters&quot;&gt;Defining Functions With No Input Parameters&lt;a class=&quot;headerlink&quot; href=&quot;#defining-functions-with-no-input-parameters&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;In this tutorial, you’ll use the example of a basic program that creates and maintains a shopping list and &lt;a href=&quot;https://realpython.com/python-print/&quot;&gt;prints it out&lt;/a&gt; when you’re ready to go to the supermarket.&lt;/p&gt;
&lt;p&gt;Start by creating a new &lt;a href=&quot;https://realpython.com/python-script-structure/&quot;&gt;Python script&lt;/a&gt; you’ll call &lt;code&gt;optional_params.py&lt;/code&gt; and add a shopping list:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;python&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    &lt;span class=&quot;mr-2&quot; aria-label=&quot;Filename&quot;&gt;&lt;code style=&quot;color: inherit; background: inherit;&quot;&gt;optional_params.py&lt;/code&gt;&lt;/span&gt;
    &lt;div class=&quot;noselect&quot;&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;shopping_list&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;Bread&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;Milk&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;Chocolate&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;Butter&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;Coffee&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;You’re using a &lt;a href=&quot;https://realpython.com/python-dicts/&quot;&gt;dictionary&lt;/a&gt; to store the item name as the key and the quantity you need to buy of each item as the value. You can &lt;a href=&quot;https://docs.python.org/3/tutorial/controlflow.html#defining-functions&quot;&gt;define a function&lt;/a&gt; to display the shopping list:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;python&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    &lt;span class=&quot;mr-2&quot; aria-label=&quot;Filename&quot;&gt;&lt;code style=&quot;color: inherit; background: inherit;&quot;&gt;optional_params.py&lt;/code&gt;&lt;/span&gt;
    &lt;div class=&quot;noselect&quot;&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;shopping_list&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;Bread&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;Milk&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;Chocolate&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;Butter&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;Coffee&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;show_list&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;():&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;item_name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;quantity&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;shopping_list&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;items&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;():&lt;/span&gt;
        &lt;span class=&quot;nb&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sa&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;quantity&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;x &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;item_name&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;show_list&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;When you &lt;a href=&quot;https://realpython.com/run-python-scripts/&quot;&gt;run this script&lt;/a&gt;, you’ll get a printout of the shopping list:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;optional_params.py
&lt;span class=&quot;go&quot;&gt;1x Bread&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;2x Milk&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;1x Chocolate&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;1x Butter&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;1x Coffee&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;The function you’ve defined has no input &lt;a href=&quot;/ref/glossary/parameter/&quot; class=&quot;ref-link&quot;&gt;parameters&lt;/a&gt;, as the parentheses in the &lt;strong&gt;function signature&lt;/strong&gt; are empty. The signature is the first line in the function definition:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;python&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;show_list&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;():&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;You don’t need any input parameters in this example since the dictionary &lt;code&gt;shopping_list&lt;/code&gt; is a &lt;strong&gt;global variable&lt;/strong&gt;. This means that it can be accessed from everywhere in the program, including from within the function definition. This is called the &lt;strong&gt;global scope&lt;/strong&gt;.&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 read more about &lt;a href=&quot;/ref/glossary/scope/&quot; class=&quot;ref-link&quot;&gt;scope&lt;/a&gt; in &lt;a href=&quot;https://realpython.com/python-scope-legb-rule/&quot;&gt;Python Scope &amp;amp; the LEGB Rule: Resolving Names in Your Code&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Using global variables in this way is not a good practice. It can lead to several functions making changes to the same data structure, which can lead to bugs that are hard to find. You’ll see how to improve on this later on in this tutorial when you pass the dictionary to the function as an argument.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-optional-arguments/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-optional-arguments/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Quiz: Using Python Optional Arguments When Defining Functions</title>
      <id>https://realpython.com/quizzes/python-optional-arguments/</id>
      <link href="https://realpython.com/quizzes/python-optional-arguments/"/>
      <updated>2025-10-27T12:00:00+00:00</updated>
      <summary>Practice Python function parameters, default values, *args, **kwargs, and safe optional arguments with quick questions and short code tasks.</summary>
      <content type="html">
        &lt;p&gt;You&amp;rsquo;ll revisit how Python handles parameters and arguments&amp;mdash;from default values and their order to flexible patterns like &lt;code&gt;*args&lt;/code&gt; and &lt;code&gt;**kwargs&lt;/code&gt;. You&amp;rsquo;ll also see when a simple Boolean flag can make your function calls clearer and more expressive.&lt;/p&gt;
&lt;p&gt;In this quiz, you&amp;rsquo;ll test your understanding of how mutable default argument values can lead to unexpected behavior. You&amp;rsquo;ll also practice unpacking sequences and mappings in function calls and formatting output with flags. For a deeper dive, check out the &lt;a href=&quot;https://realpython.com/python-optional-arguments/&quot;&gt;guide to optional arguments&lt;/a&gt;.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #271: Benchmarking Python 3.14 &amp; Enabling Asyncio to Scale</title>
      <id>https://realpython.com/podcasts/rpp/271/</id>
      <link href="https://realpython.com/podcasts/rpp/271/"/>
      <updated>2025-10-24T12:00:00+00:00</updated>
      <summary>How does Python 3.14 perform under a few hand-crafted benchmarks? Does the performance of asyncio scale on the free-threaded build? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;How does Python 3.14 perform under a few hand-crafted benchmarks? Does the performance of asyncio scale on the free-threaded build? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>What Can I Do With Python?</title>
      <id>https://realpython.com/what-can-i-do-with-python/</id>
      <link href="https://realpython.com/what-can-i-do-with-python/"/>
      <updated>2025-10-22T14:00:00+00:00</updated>
      <summary>Learn how Python builds software, powers AI, automates tasks, and drives robotics. Discover tools and projects to guide your programming journey.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;If you’re new to programming and considering Python, knowing what you can do with it can be motivating. Python is used in many fields, including web and desktop development, data science, artificial intelligence (AI), automation, robotics, and more.&lt;/p&gt;
&lt;p&gt;In this tutorial, you’ll explore tools, libraries, and project ideas that showcase Python’s versatility across these areas. By the end, you’ll know where to go next with your Python skills.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this tutorial, you’ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You can build &lt;strong&gt;web applications&lt;/strong&gt; with frameworks like Django, Flask, and FastAPI, each suitable for different scales and use cases.&lt;/li&gt;
&lt;li&gt;Python supports &lt;strong&gt;CLI&lt;/strong&gt;, &lt;strong&gt;TUI&lt;/strong&gt;, and &lt;strong&gt;GUI&lt;/strong&gt; development, giving you ways to create interactive tools from the terminal to full desktop applications.&lt;/li&gt;
&lt;li&gt;In &lt;strong&gt;data science&lt;/strong&gt; and &lt;strong&gt;AI&lt;/strong&gt;, libraries such as NumPy, pandas, scikit-learn, PyTorch, and Transformers power analysis, visualization, and machine learning.&lt;/li&gt;
&lt;li&gt;You can use Python for automation and &lt;strong&gt;DevOps&lt;/strong&gt;, managing workflows, &lt;strong&gt;packaging&lt;/strong&gt;, &lt;strong&gt;testing&lt;/strong&gt;, and even &lt;strong&gt;cybersecurity&lt;/strong&gt; tasks.&lt;/li&gt;
&lt;li&gt;Python also extends into &lt;strong&gt;embedded systems&lt;/strong&gt; and &lt;strong&gt;robotics&lt;/strong&gt;, with projects on Raspberry Pi, MicroPython, CircuitPython, and ROS.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here, you’ll find Python’s most exciting use cases, with links to projects and resources that will help you start learning the language and applying your new skills right away.&lt;/p&gt;
&lt;!-- Slim Inline Banner --&gt;
&lt;div class=&quot;card my-4 alert alert-warning&quot;&gt;
  &lt;div class=&quot;card-body py-2&quot;&gt;
    &lt;div class=&quot;d-flex align-items-center&quot;&gt;
      &lt;img src=&quot;https://files.realpython.com/media/cheat_sheets_stacked.34027e654084.png&quot; alt=&quot;Preview of the Python Cheat Sheet PDF&quot; class=&quot;mr-3&quot; style=&quot;width:120px;height:auto;flex:0 0 auto;&quot;&gt;

      &lt;div class=&quot;flex-grow-1&quot;&gt;
        &lt;div class=&quot;small mb-2&quot;&gt;
          &lt;strong&gt;Get Your Free Python Cheat Sheet (PDF):&lt;/strong&gt; Learn the basics, fast.
        &lt;/div&gt;

        &lt;form action=&quot;/optins/process/&quot; method=&quot;post&quot; class=&quot;mb-0&quot;&gt;

          &lt;input type=&quot;hidden&quot; name=&quot;slug&quot; value=&quot;cheat-sheet-slim-inline&quot;&gt;
          &lt;div class=&quot;input-group input-group-sm&quot;&gt;
            &lt;input name=&quot;email&quot; type=&quot;email&quot; class=&quot;form-control&quot; placeholder=&quot;Email address&quot; aria-label=&quot;Email address&quot; required&gt;
            &lt;div class=&quot;input-group-append&quot;&gt;
              &lt;button name=&quot;submit&quot; type=&quot;submit&quot; class=&quot;btn btn-success&quot;&gt;Get »&lt;/button&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/form&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&quot;container border rounded text-wrap-pretty my-3&quot;&gt;

  &lt;p class=&quot;my-3&quot;&gt;&lt;mark class=&quot;marker-highlight&quot;&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt;&lt;/mark&gt; Test your knowledge with our interactive “What Can I Do With Python?” quiz. You’ll receive a score upon completion to help you track your learning progress:&lt;/p&gt;

  &lt;hr&gt;

  &lt;div class=&quot;row my-3&quot;&gt;
    &lt;div class=&quot;col-xs-12 col-sm-4 col-md-3 align-self-center&quot;&gt;

      &lt;a href=&quot;/quizzes/what-can-i-do-with-python/&quot; tabindex=&quot;-1&quot;&gt;
        &lt;div class=&quot;embed-responsive embed-responsive-16by9&quot;&gt;

            &lt;img class=&quot;card-img-top m-0 p-0 embed-responsive-item rounded&quot; style=&quot;object-fit: contain; background: #abe5b2;&quot; alt=&quot;What Can I Build With Python?&quot; src=&quot;https://files.realpython.com/media/building_with_python_watermark.2ebe5beb5b1e.jpg&quot; width=&quot;1920&quot; height=&quot;1080&quot; srcset=&quot;/cdn-cgi/image/width=480,format=auto/https://files.realpython.com/media/building_with_python_watermark.2ebe5beb5b1e.jpg 480w, /cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/building_with_python_watermark.2ebe5beb5b1e.jpg 640w, /cdn-cgi/image/width=960,format=auto/https://files.realpython.com/media/building_with_python_watermark.2ebe5beb5b1e.jpg 960w, /cdn-cgi/image/width=1920,format=auto/https://files.realpython.com/media/building_with_python_watermark.2ebe5beb5b1e.jpg 1920w&quot; sizes=&quot;(min-width: 1200px) 142px, (min-width: 1000px) 122px, (min-width: 780px) 112px, (min-width: 580px) 139px, calc(100vw - 62px)&quot;&gt;


          &lt;div class=&quot;card-img-overlay d-flex align-items-center&quot;&gt;
            &lt;div class=&quot;mx-auto&quot;&gt;
              &lt;span class=&quot;text-light&quot; style=&quot;opacity: 0.90;&quot;&gt;&lt;span class=&quot;icon baseline scale2x&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/a&gt;

    &lt;/div&gt;
    &lt;div class=&quot;col&quot;&gt;
      &lt;div class=&quot;mt-3 d-md-none&quot;&gt;&lt;/div&gt; 
      &lt;p class=&quot;small text-muted mb-0&quot;&gt;&lt;strong&gt;Interactive Quiz&lt;/strong&gt;&lt;/p&gt;
      &lt;a href=&quot;/quizzes/what-can-i-do-with-python/&quot; class=&quot;stretched-link&quot;&gt;&lt;span class=&quot;my-0 h4&quot;&gt;What Can I Do With Python?&lt;/span&gt;&lt;/a&gt; 
      &lt;p class=&quot;text-muted mb-0 small&quot;&gt;Test your knowledge of what Python can and can&#x27;t do, from web and GUI apps to data science, CLI tools, and embedded systems.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;/div&gt;

&lt;h2 id=&quot;python-in-the-real-world&quot;&gt;Python in the Real World&lt;a class=&quot;headerlink&quot; href=&quot;#python-in-the-real-world&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;/ref/glossary/python/&quot; class=&quot;ref-link&quot;&gt;&lt;strong&gt;Python&lt;/strong&gt;&lt;/a&gt; is a high-level, multi-paradigm, and general-purpose programming language. As this definition implies, you can use Python for several purposes, from &lt;a href=&quot;https://realpython.com/tutorials/web-dev/&quot;&gt;web development&lt;/a&gt; to &lt;a href=&quot;https://realpython.com/tutorials/data-science/&quot;&gt;data science&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/tutorials/machine-learning/&quot;&gt;machine learning&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/tutorials/ai/&quot;&gt;artificial intelligence (AI)&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/podcasts/rpp/218/&quot;&gt;robotics&lt;/a&gt;, and more. Python’s real-world use cases are limitless.&lt;/p&gt;
&lt;p&gt;People have &lt;a href=&quot;https://www.python.org/success-stories/&quot;&gt;successfully built&lt;/a&gt; many cool projects with Python. If you take a quick look at world-class companies like Google, YouTube, Meta (Facebook, Instagram), Spotify, Netflix, and others, you’ll note that they use Python to support their services and products.&lt;/p&gt;
&lt;p&gt;Google has used Python &lt;a href=&quot;https://stackoverflow.com/questions/2560310/heavy-usage-of-python-at-google/2561008#2561008&quot;&gt;from the start&lt;/a&gt;, and it has established itself as one of the tech giant’s main server-side languages. &lt;a href=&quot;https://gvanrossum.github.io/&quot;&gt;Guido van Rossum&lt;/a&gt;, Python’s creator, worked there for several years, overseeing the language’s development.&lt;/p&gt;
&lt;p&gt;Instagram initially chose Python for its simplicity and the powerful Django framework, famously operating one of the largest Django deployments in the world. The platform continues to leverage Python, with &lt;a href=&quot;https://engineering.fb.com/2023/08/15/developer-tools/immortal-objects-for-python-instagram-meta/&quot;&gt;Django powering its frontend servers&lt;/a&gt; to manage massive growth.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://engineering.atspotify.com/2013/03/how-we-use-python-at-spotify&quot;&gt;Spotify uses the language&lt;/a&gt; for data analysis and backend services. According to its team, Python’s ease of use leads to a lightning-fast development pipeline. Spotify performs a ton of analysis to give recommendations to its users, so it needs a productive tool that works well. Python to the rescue!&lt;/p&gt;
&lt;p&gt;You’ll also find that Python has been vital for science and &lt;a href=&quot;https://realpython.com/python-news-march-2021/#python-lands-on-mars&quot;&gt;space exploration&lt;/a&gt;, with many exciting applications in &lt;a href=&quot;https://en.wikipedia.org/wiki/Robotics&quot;&gt;robotics&lt;/a&gt; and hardware control. In this tutorial, you’ll explore the wide range of fields and areas where you can apply your Python skills.&lt;/p&gt;
&lt;h2 id=&quot;build-practical-software-products-and-cool-projects&quot;&gt;Build Practical Software Products and Cool Projects&lt;a class=&quot;headerlink&quot; href=&quot;#build-practical-software-products-and-cool-projects&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Python’s ecosystem provides a rich set of &lt;a href=&quot;https://en.wikipedia.org/wiki/Software_framework&quot;&gt;frameworks&lt;/a&gt;, tools, and libraries that allow you to build almost any kind of application—from &lt;a href=&quot;https://en.wikipedia.org/wiki/World_Wide_Web&quot;&gt;web&lt;/a&gt; to &lt;a href=&quot;https://en.wikipedia.org/wiki/Desktop_metaphor&quot;&gt;desktop&lt;/a&gt; and &lt;a href=&quot;https://en.wikipedia.org/wiki/Mobile_computing&quot;&gt;mobile&lt;/a&gt;. You can even use Python to &lt;a href=&quot;https://realpython.com/top-python-game-engines/&quot;&gt;create video games&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&quot;web-development&quot;&gt;Web Development&lt;a class=&quot;headerlink&quot; href=&quot;#web-development&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Web application development&lt;/strong&gt; with Python is in high demand. In this field, you’ll find several well-established Python frameworks, libraries, and tools for developing cool web applications, &lt;a href=&quot;/ref/glossary/api/&quot; class=&quot;ref-link&quot;&gt;APIs&lt;/a&gt;, and more.&lt;/p&gt;
&lt;p&gt;Here are some of the most popular Python web frameworks:&lt;/p&gt;
&lt;div class=&quot;table-responsive&quot;&gt;
&lt;table class=&quot;table table-hover&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Framework&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://www.djangoproject.com/&quot;&gt;Django&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;A high-level framework that encourages rapid web application development with a clean and pragmatic design. It allows you to focus on writing your applications without reinventing the wheel.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://fastapi.tiangolo.com/&quot;&gt;FastAPI&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;A fast and performant web framework for building web APIs. It’s built on top of modern Python type hinting features and enables &lt;a href=&quot;#concurrency-and-async-programming&quot;&gt;asynchronous programming&lt;/a&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://palletsprojects.com/p/flask/&quot;&gt;Flask&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;A lightweight framework primarily focused on creating &lt;a href=&quot;https://wsgi.readthedocs.io/&quot;&gt;WSGI&lt;/a&gt; web applications. It allows you to start quickly and scale up to complex applications if needed.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tornadoweb.org/en/stable/&quot;&gt;Tornado&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;A web framework and asynchronous networking library. It uses &lt;a href=&quot;/ref/glossary/non-blocking-operation/&quot; class=&quot;ref-link&quot;&gt;non-blocking&lt;/a&gt; network &lt;a href=&quot;/ref/glossary/input-output/&quot; class=&quot;ref-link&quot;&gt;I/O&lt;/a&gt;, enabling you to write applications that can scale to tens of thousands of open connections.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;To get started with web development in Python, check out the following resources:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/learning-paths/django-web-development/&quot;&gt;Django for Web Development (Learning Path)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/learning-paths/flask-by-example/&quot;&gt;Flask by Example (Learning Path)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/fastapi-python-web-apis/&quot;&gt;Using FastAPI to Build Python Web APIs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/api-integration-in-python/&quot;&gt;Python and REST APIs: Interacting With Web Services&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/tutorials/web-dev/&quot;&gt;Python Web Development Tutorials&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/tutorials/api/&quot;&gt;Python API Tutorials&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you want some practical project ideas for applying your web development skills right away, check out these tutorials:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/python-web-applications/&quot;&gt;Python Web Applications: Deploy Your Script as a Flask App&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/get-started-with-fastapi/&quot;&gt;Get Started With FastAPI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/get-started-with-django-1/&quot;&gt;Get Started With Django: Build a Portfolio App&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/django-diary-project-python/&quot;&gt;Build a Personal Diary With Django and Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/build-a-blog-from-scratch-django/&quot;&gt;Build a Blog From Scratch With Django&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/flask-connexion-rest-api/&quot;&gt;Python REST APIs With Flask, Connexion, and SQLAlchemy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/python-code-image-generator/&quot;&gt;Build a Code Image Generator With Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/django-flashcards-app/&quot;&gt;Build a Flashcards App With Django&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/build-a-python-url-shortener-with-fastapi/&quot;&gt;Build a URL Shortener With FastAPI and Python&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/what-can-i-do-with-python/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/what-can-i-do-with-python/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Quiz: What Can I Do With Python?</title>
      <id>https://realpython.com/quizzes/what-can-i-do-with-python/</id>
      <link href="https://realpython.com/quizzes/what-can-i-do-with-python/"/>
      <updated>2025-10-22T12:00:00+00:00</updated>
      <summary>Test your knowledge of what Python can and can&#x27;t do, from web and GUI apps to data science, CLI tools, and embedded systems.</summary>
      <content type="html">
        &lt;p&gt;How well do you know the different areas where Python shines? In this quiz, you&amp;rsquo;ll revisit web apps and APIs, GUI apps, CLI tools, machine learning, and more.&lt;/p&gt;
&lt;p&gt;You&amp;rsquo;ll also check what Python isn&amp;rsquo;t suited for and which alternatives work better. Get ready to explore the wide scope of &lt;a href=&quot;https://realpython.com/what-can-i-do-with-python/&quot;&gt;what you can do with Python&lt;/a&gt;.&lt;/p&gt;
        &lt;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>Investigating Quasar Data With Polars and Interactive marimo Notebooks</title>
      <id>https://realpython.com/courses/investigating-quasar-data-polars-marimo-notebooks/</id>
      <link href="https://realpython.com/courses/investigating-quasar-data-polars-marimo-notebooks/"/>
      <updated>2025-10-21T14:00:00+00:00</updated>
      <summary>Learn to visualize quasar redshift data by building an interactive marimo dashboard using Polars, pandas, and Matplotlib.</summary>
      <content type="html">
        &lt;p&gt;Learn to visualize quasar redshift data by building an interactive marimo dashboard using Polars, pandas, and Matplotlib. You&amp;rsquo;ll practice retrieving, cleaning, and displaying data in your notebook. You&amp;rsquo;ll also build interactive UI components that live-update visualizations in the notebook.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>When Should You Use .__repr__() vs .__str__() in Python?</title>
      <id>https://realpython.com/python-repr-vs-str/</id>
      <link href="https://realpython.com/python-repr-vs-str/"/>
      <updated>2025-10-20T14:00:00+00:00</updated>
      <summary>Find out when to choose Python&#x27;s __repr__() vs __str__() in your classes so your objects show helpful information for debugging and user output.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;One of the most common tasks that a computer program performs is to &lt;strong&gt;display data&lt;/strong&gt;. The program often displays this information to the program’s user. However, a program also needs to show information to the programmer developing and maintaining it. The information a programmer needs about an object differs from how the program should display the same object for the user, and that’s where &lt;code&gt;.__repr__()&lt;/code&gt; vs &lt;code&gt;.__str__()&lt;/code&gt; comes in.&lt;/p&gt;
&lt;p&gt;A Python object has several special methods that provide specific behavior. There are two similar &lt;strong&gt;special methods&lt;/strong&gt; that describe the object using a string representation. These methods are &lt;code&gt;.__repr__()&lt;/code&gt; and &lt;code&gt;.__str__()&lt;/code&gt;. The &lt;code&gt;.__repr__()&lt;/code&gt; method returns a &lt;strong&gt;detailed description&lt;/strong&gt; for a programmer who needs to maintain and debug the code. The &lt;code&gt;.__str__()&lt;/code&gt; method returns a &lt;strong&gt;simpler description&lt;/strong&gt; with information for the user of the program.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;.__repr__()&lt;/code&gt; and &lt;code&gt;.__str__()&lt;/code&gt; methods are two of the special methods that you can define for any class. They allow you to control how a program displays an object in several common forms of output, such as what you get from the &lt;code&gt;print()&lt;/code&gt; function, formatted strings, and interactive environments.&lt;/p&gt;
&lt;p&gt;In this tutorial, you’ll learn how to differentiate &lt;code&gt;.__repr__()&lt;/code&gt; vs &lt;code&gt;.__str__()&lt;/code&gt; and how to use these special methods in the classes you define. Defining these methods effectively makes the classes that you write more readable and easier to debug and maintain. So, &lt;strong&gt;when should you choose Python’s &lt;code&gt;.__repr__()&lt;/code&gt; vs &lt;code&gt;.__str__()&lt;/code&gt;?&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Free Download:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-tricks-sample-pdf/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-tricks-sample-pdf&quot; markdown&gt;Get a sample chapter from Python Tricks: The Book&lt;/a&gt; that shows you Python’s best practices with simple examples you can apply instantly to write more beautiful + Pythonic code.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;container border rounded text-wrap-pretty my-3&quot;&gt;

  &lt;p class=&quot;my-3&quot;&gt;&lt;mark class=&quot;marker-highlight&quot;&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt;&lt;/mark&gt; Test your knowledge with our interactive “Using .__repr__() vs .__str__() in Python” quiz. You’ll receive a score upon completion to help you track your learning progress:&lt;/p&gt;

  &lt;hr&gt;

  &lt;div class=&quot;row my-3&quot;&gt;
    &lt;div class=&quot;col-xs-12 col-sm-4 col-md-3 align-self-center&quot;&gt;

      &lt;a href=&quot;/quizzes/python-repr-vs-str/&quot; tabindex=&quot;-1&quot;&gt;
        &lt;div class=&quot;embed-responsive embed-responsive-16by9&quot;&gt;

            &lt;img class=&quot;card-img-top m-0 p-0 embed-responsive-item rounded&quot; style=&quot;object-fit: contain; background: #abe5b2;&quot; alt=&quot;When Should You Use .__repr__() vs .__str__() in Python?&quot; src=&quot;https://files.realpython.com/media/Pythons-.__repr__-vs-.__str__-Whats-the-Difference_Watermarked.a96767464f75.jpg&quot; width=&quot;1920&quot; height=&quot;1080&quot; srcset=&quot;/cdn-cgi/image/width=480,format=auto/https://files.realpython.com/media/Pythons-.__repr__-vs-.__str__-Whats-the-Difference_Watermarked.a96767464f75.jpg 480w, /cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/Pythons-.__repr__-vs-.__str__-Whats-the-Difference_Watermarked.a96767464f75.jpg 640w, /cdn-cgi/image/width=960,format=auto/https://files.realpython.com/media/Pythons-.__repr__-vs-.__str__-Whats-the-Difference_Watermarked.a96767464f75.jpg 960w, /cdn-cgi/image/width=1920,format=auto/https://files.realpython.com/media/Pythons-.__repr__-vs-.__str__-Whats-the-Difference_Watermarked.a96767464f75.jpg 1920w&quot; sizes=&quot;(min-width: 1200px) 142px, (min-width: 1000px) 122px, (min-width: 780px) 112px, (min-width: 580px) 139px, calc(100vw - 62px)&quot;&gt;


          &lt;div class=&quot;card-img-overlay d-flex align-items-center&quot;&gt;
            &lt;div class=&quot;mx-auto&quot;&gt;
              &lt;span class=&quot;text-light&quot; style=&quot;opacity: 0.90;&quot;&gt;&lt;span class=&quot;icon baseline scale2x&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/a&gt;

    &lt;/div&gt;
    &lt;div class=&quot;col&quot;&gt;
      &lt;div class=&quot;mt-3 d-md-none&quot;&gt;&lt;/div&gt; 
      &lt;p class=&quot;small text-muted mb-0&quot;&gt;&lt;strong&gt;Interactive Quiz&lt;/strong&gt;&lt;/p&gt;
      &lt;a href=&quot;/quizzes/python-repr-vs-str/&quot; class=&quot;stretched-link&quot;&gt;&lt;span class=&quot;my-0 h4&quot;&gt;Using .__repr__() vs .__str__() in Python&lt;/span&gt;&lt;/a&gt; 
      &lt;p class=&quot;text-muted mb-0 small&quot;&gt;In this quiz, you&#x27;ll test your understanding of Python&#x27;s dunder repr and dunder str special methods. These methods allow you to control how a program displays an object, making your classes more readable and easier to debug and maintain.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;/div&gt;

&lt;h2 id=&quot;in-short-use-__repr__-for-programmers-vs-__str__-for-users&quot;&gt;In Short: Use &lt;code&gt;.__repr__()&lt;/code&gt; for Programmers vs &lt;code&gt;.__str__()&lt;/code&gt; for Users&lt;a class=&quot;headerlink&quot; href=&quot;#in-short-use-__repr__-for-programmers-vs-__str__-for-users&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://realpython.com/python-classes/&quot;&gt;Python classes&lt;/a&gt; have a number of &lt;a href=&quot;https://realpython.com/python-classes/#special-methods-and-protocols&quot;&gt;special methods&lt;/a&gt;. These methods have a double leading underscore and a double trailing underscore in their names. You can informally refer to them as dunder methods because of the &lt;a href=&quot;https://realpython.com/python-double-underscore/&quot;&gt;double underscores&lt;/a&gt; in their names.&lt;/p&gt;
&lt;p&gt;The special methods &lt;a href=&quot;https://docs.python.org/3/reference/datamodel.html#object.__repr__&quot;&gt;&lt;code&gt;.__repr__()&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://docs.python.org/3/reference/datamodel.html#object.__str__&quot;&gt;&lt;code&gt;.__str__()&lt;/code&gt;&lt;/a&gt; both return string representations of the object. A string representation is a string that shows information about the object. You can tailor this information for different audiences, such as program users or your fellow programmers.&lt;/p&gt;
&lt;p&gt;Like with other special methods with leading and trailing double underscores in their names, you can define these methods for any class.&lt;/p&gt;
&lt;p&gt;The reason there are two methods to display an object is that they have different purposes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;.__repr__()&lt;/code&gt; provides the &lt;strong&gt;official string representation&lt;/strong&gt; of an object, aimed at the programmer.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;.__str__()&lt;/code&gt; provides the &lt;strong&gt;informal string representation&lt;/strong&gt; of an object, aimed at the user.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The target audience for the string representation returned by &lt;code&gt;.__repr__()&lt;/code&gt; is the programmer developing and maintaining the program. In general, it provides detailed and unambiguous information about the object. Another important property of the official string representation is that a programmer can normally use it to re-create an object equal to the original one. &lt;/p&gt;
&lt;p&gt;The &lt;code&gt;.__str__()&lt;/code&gt; method provides a string representation targeted to the program’s user, who may not necessarily be a Python programmer. Therefore, this representation enables any user to understand the data contained in the object. Usually, it’s simpler and easier to read for a user.&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; For a discussion of these two special methods, check out the &lt;a href=&quot;https://realpython.com/podcasts/rpp/153/&quot;&gt;The Real Python Podcast: Episode 153&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;One way of displaying both representations of an object is by using &lt;a href=&quot;https://realpython.com/python-repl/&quot;&gt;Python’s standard REPL&lt;/a&gt;. The REPL will display the string representation from &lt;code&gt;.__repr__()&lt;/code&gt; when you evaluate a line that only has an object on it. However, the built-in function &lt;a href=&quot;https://realpython.com/python-print/&quot;&gt;&lt;code&gt;print()&lt;/code&gt;&lt;/a&gt; shows the informal string representation returned by &lt;code&gt;.__str__()&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;You can view the strings returned by &lt;code&gt;.__repr__()&lt;/code&gt; vs &lt;code&gt;.__str__()&lt;/code&gt; for an instance of the &lt;code&gt;datetime&lt;/code&gt; class in the &lt;a href=&quot;https://realpython.com/python-datetime/&quot;&gt;&lt;code&gt;datetime&lt;/code&gt;&lt;/a&gt; module:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nn&quot;&gt;datetime&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;today&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;datetime&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;datetime&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;now&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;today&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;datetime.datetime(2025, 9, 17, 10, 25, 55, 515728)&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;today&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;2025-09-17 10:25:55.515728&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;You create a &lt;code&gt;datetime.datetime&lt;/code&gt; object named &lt;code&gt;today&lt;/code&gt; using &lt;a href=&quot;https://docs.python.org/3/library/datetime.html#datetime.datetime.now&quot;&gt;&lt;code&gt;.now()&lt;/code&gt;&lt;/a&gt;. This method returns the current date and time. When you evaluate the line containing only the variable name &lt;code&gt;today&lt;/code&gt;, the REPL displays the string representation returned by &lt;code&gt;.__repr__()&lt;/code&gt;. This representation shows the name of the data type and all the arguments needed to re-create the object.&lt;/p&gt;
&lt;p&gt;When you use &lt;code&gt;print()&lt;/code&gt;, the REPL displays the representation of &lt;code&gt;today&lt;/code&gt; returned by &lt;code&gt;.__str__()&lt;/code&gt;. For &lt;code&gt;datetime&lt;/code&gt; objects, this is equivalent to calling &lt;code&gt;today.isoformat(&quot; &quot;)&lt;/code&gt;. This returns an &lt;a href=&quot;https://www.iso.org/iso-8601-date-and-time-format.html&quot;&gt;ISO 8601–style format&lt;/a&gt; that uses a space between the date and time. Therefore, this is not a Python-specific format but a standard that’s used more broadly to represent dates and times.&lt;/p&gt;
&lt;p&gt;Often, the official string representation is a valid Python expression that you can use to create a new object with the same value. You can confirm this with the &lt;code&gt;datetime.datetime&lt;/code&gt; object by copying the official string representation and assigning it to a new name. You can also attempt to use the informal string representation, but this won’t work:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new_date&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;datetime&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;datetime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2025&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;17&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;25&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;55&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;515728&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;new_date&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;today&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;True&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;new_date&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2025&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;09&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;17&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;25&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;55.515728&lt;/span&gt;
&lt;span class=&quot;gt&quot;&gt;Traceback (most recent call last):&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;c&quot;&gt;...&lt;/span&gt;
  File &lt;span class=&quot;nb&quot;&gt;&quot;&amp;lt;input&amp;gt;&quot;&lt;/span&gt;, line &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new_date&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2025&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;09&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;17&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;25&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;55.515728&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;                    &lt;/span&gt;&lt;span class=&quot;pm&quot;&gt;^&lt;/span&gt;
&lt;span class=&quot;gr&quot;&gt;SyntaxError&lt;/span&gt;: &lt;span class=&quot;n&quot;&gt;leading zeros in decimal integer literals are not permitted ...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;The output you got from &lt;code&gt;.__repr__()&lt;/code&gt; when you evaluated &lt;code&gt;today&lt;/code&gt; in the REPL created a new object equal to the original one.&lt;/p&gt;
&lt;p&gt;However, the string representation from &lt;code&gt;.__str__()&lt;/code&gt;, which you got when you used &lt;code&gt;print()&lt;/code&gt;, isn’t a valid Python expression, so it raises a &lt;code&gt;SyntaxError&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;You can also show the string representations for common built-in data types:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-repr-vs-str/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-repr-vs-str/ »&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 #270: Evolving Teaching Python in the Classroom</title>
      <id>https://realpython.com/podcasts/rpp/270/</id>
      <link href="https://realpython.com/podcasts/rpp/270/"/>
      <updated>2025-10-17T12:00:00+00:00</updated>
      <summary>How is teaching young students Python changing with the advent of LLMs? This week on the show, Kelly Schuster-Paredes from the Teaching Python podcast joins us to discuss coding and AI in the classroom.</summary>
      <content type="html">
        &lt;p&gt;How is teaching young students Python changing with the advent of LLMs? This week on the show, Kelly Schuster-Paredes from the Teaching Python podcast joins us to discuss coding and AI in the classroom.&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>Polars vs pandas: What&#x27;s the Difference?</title>
      <id>https://realpython.com/polars-vs-pandas/</id>
      <link href="https://realpython.com/polars-vs-pandas/"/>
      <updated>2025-10-15T14:00:00+00:00</updated>
      <summary>Discover the key differences in Polars vs pandas to help you choose the right Python library for faster, more efficient data analysis.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Polars and pandas both provide DataFrame-based data analysis in Python, but they differ in syntax, performance, and features. In this tutorial on Polars vs pandas, you’ll compare their method chaining styles, run timed performance tests, explore LazyFrame optimizations in Polars, convert data between the two libraries, and create plots with their built-in tools. You’ll also examine scenarios where each library’s strengths make it the better choice.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this tutorial, you’ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Polars expressions and contexts&lt;/strong&gt; let you build clear, optimized query pipelines without mutating your original data.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;LazyFrames with query optimization&lt;/strong&gt; in Polars can outperform pandas for grouped and aggregated workloads.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Streaming in Polars&lt;/strong&gt; enables processing datasets that don’t fit in memory, which pandas can’t handle natively.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;.to_pandas()&lt;/code&gt; and &lt;code&gt;from_pandas()&lt;/code&gt;&lt;/strong&gt; let you convert between DataFrame formats, and Narwhals offers a library-agnostic API.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Built-in plotting&lt;/strong&gt; uses Altair for Polars and Matplotlib for pandas, allowing quick visualization directly from DataFrames.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To get the most out of this tutorial, it’s recommended that you already have a basic understanding of how to work with both &lt;a href=&quot;https://realpython.com/pandas-dataframe/&quot;&gt;pandas&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/polars-python/&quot;&gt;Polars DataFrames&lt;/a&gt;, as well as &lt;a href=&quot;https://realpython.com/polars-lazyframe/&quot;&gt;Polars LazyFrames&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To complete the examples in this tutorial, you’ll use various tools and the &lt;a href=&quot;https://realpython.com/python-repl/&quot;&gt;Python REPL&lt;/a&gt;. You’ll use the &lt;a href=&quot;https://realpython.com/python-command-line-arguments/&quot;&gt;command line&lt;/a&gt; to run some scripts that &lt;a href=&quot;https://realpython.com/python-timer/&quot;&gt;time your code&lt;/a&gt; and reveal how pandas and Polars compare. You’ll also take advantage of the plotting capabilities of &lt;a href=&quot;https://realpython.com/jupyter-notebook-introduction/&quot;&gt;Jupyter Notebook&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Much of the data you’ll use will be &lt;a href=&quot;https://realpython.com/python-random/&quot;&gt;random&lt;/a&gt; and self-generated. You’ll also use a cleansed and reformatted &lt;a href=&quot;https://en.wikipedia.org/wiki/Apache_Parquet&quot;&gt;Apache Parquet&lt;/a&gt; version of some freely available retail data from the &lt;a href=&quot;https://archive.ics.uci.edu/dataset/352/online+retail&quot;&gt;UC Irvine Machine Learning Repository&lt;/a&gt;. Parquet files are optimized to store data and analyze it efficiently. This enables you to achieve optimal performance from the pandas and Polars libraries.&lt;/p&gt;
&lt;p&gt;Before you start, you should download the &lt;code&gt;online_retail.parquet&lt;/code&gt; file from the tutorial downloadables and place it into your project directory.&lt;/p&gt;
&lt;p&gt;You’ll need to install the &lt;a href=&quot;https://pandas.pydata.org/docs/&quot;&gt;pandas&lt;/a&gt; and &lt;a href=&quot;https://pola.rs/&quot;&gt;Polars&lt;/a&gt; libraries, as well as &lt;a href=&quot;https://pyarrow.readthedocs.io/en/latest/&quot;&gt;PyArrow&lt;/a&gt;, &lt;a href=&quot;https://matplotlib.org/&quot;&gt;Matplotlib&lt;/a&gt;, &lt;a href=&quot;https://altair-viz.github.io/index.html&quot;&gt;Vega-Altair&lt;/a&gt;, and &lt;a href=&quot;https://narwhals-dev.github.io/narwhals/&quot;&gt;Narwhals&lt;/a&gt;, to make sure your code has everything it needs to run. You’ll also use &lt;a href=&quot;https://numpy.org/doc/&quot;&gt;NumPy&lt;/a&gt;, which is currently installed automatically when you install pandas. &lt;/p&gt;
&lt;p&gt;You may also want to consider creating your own &lt;a href=&quot;https://realpython.com/python-virtual-environments-a-primer/&quot;&gt;virtual environment&lt;/a&gt; within your project folder to install the necessary libraries. This will prevent them from interfering with your current setup.&lt;/p&gt;
&lt;p&gt;You can install the required libraries using these commands at your command prompt:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;-m&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;pip&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;install&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;polars&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;                        &lt;/span&gt;pandas&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;                        &lt;/span&gt;pyarrow&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;                        &lt;/span&gt;narwhals&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;                        &lt;/span&gt;altair&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;                        &lt;/span&gt;jupyterlab&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;                        &lt;/span&gt;matplotlib
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;All the code examples are provided in the downloadable materials for this tutorial, which you can download by clicking the link below:&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/polars-vs-pandas-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-polars-vs-pandas-code&quot; markdown&gt;Click here to download the free sample code &lt;/a&gt; you’ll use to learn the differences between Polars and pandas.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Now that you’re set up, it’s time to get started and learn about the main differences between Polars and pandas.&lt;/p&gt;
&lt;div class=&quot;container border rounded text-wrap-pretty my-3&quot;&gt;

  &lt;p class=&quot;my-3&quot;&gt;&lt;mark class=&quot;marker-highlight&quot;&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt;&lt;/mark&gt; Test your knowledge with our interactive “Polars vs pandas: What&#x27;s the Difference?” quiz. You’ll receive a score upon completion to help you track your learning progress:&lt;/p&gt;

  &lt;hr&gt;

  &lt;div class=&quot;row my-3&quot;&gt;
    &lt;div class=&quot;col-xs-12 col-sm-4 col-md-3 align-self-center&quot;&gt;

      &lt;a href=&quot;/quizzes/polars-vs-pandas/&quot; tabindex=&quot;-1&quot;&gt;
        &lt;div class=&quot;embed-responsive embed-responsive-16by9&quot;&gt;

            &lt;img class=&quot;card-img-top m-0 p-0 embed-responsive-item rounded&quot; style=&quot;object-fit: contain; background: #ffc873;&quot; alt=&quot;Polars vs pandas: What&#x27;s the Difference?&quot; src=&quot;https://files.realpython.com/media/Polars-vs-Pandas_Watermarked.0021a1a79975.jpg&quot; width=&quot;1920&quot; height=&quot;1080&quot; srcset=&quot;/cdn-cgi/image/width=480,format=auto/https://files.realpython.com/media/Polars-vs-Pandas_Watermarked.0021a1a79975.jpg 480w, /cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/Polars-vs-Pandas_Watermarked.0021a1a79975.jpg 640w, /cdn-cgi/image/width=960,format=auto/https://files.realpython.com/media/Polars-vs-Pandas_Watermarked.0021a1a79975.jpg 960w, /cdn-cgi/image/width=1920,format=auto/https://files.realpython.com/media/Polars-vs-Pandas_Watermarked.0021a1a79975.jpg 1920w&quot; sizes=&quot;(min-width: 1200px) 142px, (min-width: 1000px) 122px, (min-width: 780px) 112px, (min-width: 580px) 139px, calc(100vw - 62px)&quot;&gt;


          &lt;div class=&quot;card-img-overlay d-flex align-items-center&quot;&gt;
            &lt;div class=&quot;mx-auto&quot;&gt;
              &lt;span class=&quot;text-light&quot; style=&quot;opacity: 0.90;&quot;&gt;&lt;span class=&quot;icon baseline scale2x&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/a&gt;

    &lt;/div&gt;
    &lt;div class=&quot;col&quot;&gt;
      &lt;div class=&quot;mt-3 d-md-none&quot;&gt;&lt;/div&gt; 
      &lt;p class=&quot;small text-muted mb-0&quot;&gt;&lt;strong&gt;Interactive Quiz&lt;/strong&gt;&lt;/p&gt;
      &lt;a href=&quot;/quizzes/polars-vs-pandas/&quot; class=&quot;stretched-link&quot;&gt;&lt;span class=&quot;my-0 h4&quot;&gt;Polars vs pandas: What&#x27;s the Difference?&lt;/span&gt;&lt;/a&gt; 
      &lt;p class=&quot;text-muted mb-0 small&quot;&gt;Take this quiz to test your knowledge of the Polars vs pandas tutorial and review the key differences between these open-source Python libraries.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;/div&gt;

&lt;h2 id=&quot;do-polars-and-pandas-use-the-same-syntax&quot;&gt;Do Polars and pandas Use the Same Syntax?&lt;a class=&quot;headerlink&quot; href=&quot;#do-polars-and-pandas-use-the-same-syntax&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;There are similarities between Polars and pandas. For example, they both support Series and DataFrames and can perform many of the same data analysis computations. However, there are some differences in their syntax.&lt;/p&gt;
&lt;p&gt;To explore this, you’ll use the order details in your &lt;code&gt;online_retail.parquet&lt;/code&gt; file to analyze both pandas and Polars DataFrames. This file contains the following data:&lt;/p&gt;
&lt;div class=&quot;table-responsive&quot;&gt;
&lt;table class=&quot;table table-hover&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Column Name&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;InvoiceNo&lt;/td&gt;
&lt;td&gt;Invoice number&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;StockCode&lt;/td&gt;
&lt;td&gt;Stock code of item&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Description&lt;/td&gt;
&lt;td&gt;Item description&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Quantity&lt;/td&gt;
&lt;td&gt;Quantity purchased&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;InvoiceDate&lt;/td&gt;
&lt;td&gt;Date invoiced&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UnitPrice&lt;/td&gt;
&lt;td&gt;Item price&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CustomerID&lt;/td&gt;
&lt;td&gt;Customer identifier&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Country&lt;/td&gt;
&lt;td&gt;Country of purchase made&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;Next, you’ll analyze some of this data with pandas and then with Polars.&lt;/p&gt;
&lt;h3 id=&quot;using-index-based-syntax-in-pandas&quot;&gt;Using Index-Based Syntax in pandas&lt;a class=&quot;headerlink&quot; href=&quot;#using-index-based-syntax-in-pandas&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Suppose you want a DataFrame with a new &lt;code&gt;Total&lt;/code&gt; column that contains the total cost of each purchase. You also want to apply filtering so you can concentrate on specific data.&lt;/p&gt;
&lt;p&gt;To achieve this, you might write the following pandas code in your &lt;a href=&quot;/ref/glossary/repl/&quot; class=&quot;ref-link&quot;&gt;REPL&lt;/a&gt;:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    &lt;span class=&quot;mr-2&quot; aria-label=&quot;Filename&quot;&gt;&lt;code style=&quot;color: inherit; background: inherit;&quot;&gt;pandas_polars_demo.py&lt;/code&gt;&lt;/span&gt;
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nn&quot;&gt;pandas&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;as&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nn&quot;&gt;pd&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;orders_pandas&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_parquet&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;online_retail.parquet&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;orders_pandas&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Total&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;orders_pandas&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Quantity&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;orders_pandas&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;UnitPrice&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;&lt;span class=&quot;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;orders_pandas&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;InvoiceNo&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Quantity&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;UnitPrice&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Total&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]][&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;orders_pandas&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Total&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;100&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;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;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;    InvoiceNo  Quantity  UnitPrice  Total&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;46     536371        80       2.55  204.0&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;65     536374        32      10.95  350.4&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;82     536376        48       3.45  165.6&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;This code uses pandas &lt;strong&gt;index-based syntax&lt;/strong&gt;, inspired by NumPy, on which pandas was originally built. First, you add a new &lt;code&gt;Total&lt;/code&gt; column to your DataFrame. The column is calculated by multiplying the values of the &lt;code&gt;Quantity&lt;/code&gt; and &lt;code&gt;UnitPrice&lt;/code&gt; columns together. This operation permanently changes your original DataFrame.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/polars-vs-pandas/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/polars-vs-pandas/ »&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>Quiz: Polars vs pandas: What&#x27;s the Difference?</title>
      <id>https://realpython.com/quizzes/polars-vs-pandas/</id>
      <link href="https://realpython.com/quizzes/polars-vs-pandas/"/>
      <updated>2025-10-15T12:00:00+00:00</updated>
      <summary>Take this quiz to test your knowledge of the Polars vs pandas tutorial and review the key differences between these open-source Python libraries.</summary>
      <content type="html">
        &lt;p&gt;In this quiz, you&amp;rsquo;ll test your understanding of the &lt;a href=&quot;https://realpython.com/polars-vs-pandas/&quot;&gt;Polars vs pandas: What&amp;rsquo;s the Difference?&lt;/a&gt; tutorial. Most of the answers are somewhere in the tutorial, but you may need to use some of the links to clarify some of the questions.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Python Descriptors</title>
      <id>https://realpython.com/courses/python-descriptors/</id>
      <link href="https://realpython.com/courses/python-descriptors/"/>
      <updated>2025-10-14T14:00:00+00:00</updated>
      <summary>Learn what Python descriptors are, how the descriptor protocol works, and when descriptors are useful—with practical, hands-on examples.</summary>
      <content type="html">
        &lt;p&gt;&lt;strong&gt;Descriptors&lt;/strong&gt; are a specific Python feature that power a lot of the magic hidden under the language&amp;rsquo;s hood. If you&amp;rsquo;ve ever thought that Python descriptors are an advanced topic with few practical applications, then this video course is the perfect tool to help you understand this powerful feature. You&amp;rsquo;ll come to understand why Python descriptors are such an interesting topic and discover the kinds of use cases where you can apply them.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this video course, you&amp;rsquo;ll know:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What &lt;strong&gt;Python descriptors&lt;/strong&gt; are&lt;/li&gt;
&lt;li&gt;Where they&amp;rsquo;re used in Python&amp;rsquo;s &lt;strong&gt;internals&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to &lt;strong&gt;implement&lt;/strong&gt; your own descriptors&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;When to use&lt;/strong&gt; Python descriptors&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>How to Use Python: Your First Steps</title>
      <id>https://realpython.com/python-first-steps/</id>
      <link href="https://realpython.com/python-first-steps/"/>
      <updated>2025-10-13T14:00:00+00:00</updated>
      <summary>Learn how to use Python—install it, run code, and work with data types, functions, classes, and loops. Explore essential tools and build a solid foundation.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;If you’re starting fresh with programming and wondering how to use Python, this tutorial will give you the foundation you need to get started with Python step by step. You’ll learn how to install Python, run your first program, and understand the language’s clear syntax.&lt;/p&gt;
&lt;p&gt;You’ll also explore variables, loops, functions, classes, and error handling while discovering tools, coding style, and libraries that help you write effective Python code from day one.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this tutorial, you’ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You can &lt;strong&gt;install Python&lt;/strong&gt; on Windows, macOS, and Linux using binaries, package managers, or distributions like Anaconda.&lt;/li&gt;
&lt;li&gt;You can use the &lt;strong&gt;Python REPL&lt;/strong&gt; to experiment &lt;strong&gt;interactively&lt;/strong&gt; before writing full scripts, modules, and projects.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Built-in data types&lt;/strong&gt; like strings, lists, dictionaries, and sets provide powerful ways to structure information.&lt;/li&gt;
&lt;li&gt;You can &lt;strong&gt;handle errors&lt;/strong&gt; with syntax checks, exceptions, and debugging practices to keep your code running smoothly.&lt;/li&gt;
&lt;li&gt;Tools like &lt;strong&gt;editors&lt;/strong&gt;, &lt;strong&gt;integrated development environments (IDEs)&lt;/strong&gt;, and &lt;strong&gt;AI assistants&lt;/strong&gt; can boost your productivity when writing Python code.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You’ll go through your first steps with clear examples so that you can start coding in Python confidently and build on solid ground.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-first-steps-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-first-steps-code&quot; markdown&gt;Click here to download the free sample code&lt;/a&gt; that shows you how to use Python.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;container border rounded text-wrap-pretty my-3&quot;&gt;

  &lt;p class=&quot;my-3&quot;&gt;&lt;mark class=&quot;marker-highlight&quot;&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt;&lt;/mark&gt; Test your knowledge with our interactive “How to Use Python: Your First Steps” quiz. You’ll receive a score upon completion to help you track your learning progress:&lt;/p&gt;

  &lt;hr&gt;

  &lt;div class=&quot;row my-3&quot;&gt;
    &lt;div class=&quot;col-xs-12 col-sm-4 col-md-3 align-self-center&quot;&gt;

      &lt;a href=&quot;/quizzes/python-first-steps/&quot; tabindex=&quot;-1&quot;&gt;
        &lt;div class=&quot;embed-responsive embed-responsive-16by9&quot;&gt;

            &lt;img class=&quot;card-img-top m-0 p-0 embed-responsive-item rounded&quot; style=&quot;object-fit: contain; background: #ff7e74;&quot; alt=&quot;How to Use Python: Your First Steps&quot; src=&quot;https://files.realpython.com/media/UPDATE-First-Steps-With-Python_Watermarked.256721df5607.jpg&quot; width=&quot;1920&quot; height=&quot;1080&quot; srcset=&quot;/cdn-cgi/image/width=480,format=auto/https://files.realpython.com/media/UPDATE-First-Steps-With-Python_Watermarked.256721df5607.jpg 480w, /cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/UPDATE-First-Steps-With-Python_Watermarked.256721df5607.jpg 640w, /cdn-cgi/image/width=960,format=auto/https://files.realpython.com/media/UPDATE-First-Steps-With-Python_Watermarked.256721df5607.jpg 960w, /cdn-cgi/image/width=1920,format=auto/https://files.realpython.com/media/UPDATE-First-Steps-With-Python_Watermarked.256721df5607.jpg 1920w&quot; sizes=&quot;(min-width: 1200px) 142px, (min-width: 1000px) 122px, (min-width: 780px) 112px, (min-width: 580px) 139px, calc(100vw - 62px)&quot;&gt;


          &lt;div class=&quot;card-img-overlay d-flex align-items-center&quot;&gt;
            &lt;div class=&quot;mx-auto&quot;&gt;
              &lt;span class=&quot;text-light&quot; style=&quot;opacity: 0.90;&quot;&gt;&lt;span class=&quot;icon baseline scale2x&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/a&gt;

    &lt;/div&gt;
    &lt;div class=&quot;col&quot;&gt;
      &lt;div class=&quot;mt-3 d-md-none&quot;&gt;&lt;/div&gt; 
      &lt;p class=&quot;small text-muted mb-0&quot;&gt;&lt;strong&gt;Interactive Quiz&lt;/strong&gt;&lt;/p&gt;
      &lt;a href=&quot;/quizzes/python-first-steps/&quot; class=&quot;stretched-link&quot;&gt;&lt;span class=&quot;my-0 h4&quot;&gt;How to Use Python: Your First Steps&lt;/span&gt;&lt;/a&gt; 
      &lt;p class=&quot;text-muted mb-0 small&quot;&gt;Review the basics of Python with this quiz. Practice syntax, keywords, variables, errors, and tools every beginner should know.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-should-you-use-python&quot;&gt;Why Should You Use Python?&lt;a class=&quot;headerlink&quot; href=&quot;#why-should-you-use-python&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;figure class=&quot;js-lightbox&quot;&gt;&lt;a href=&quot;https://files.realpython.com/media/pythonlogo.0658b34b4498.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid w-25 float-right&quot; src=&quot;https://files.realpython.com/media/pythonlogo.0658b34b4498.jpg&quot; width=&quot;680&quot; height=&quot;459&quot; srcset=&quot;/cdn-cgi/image/width=170,format=auto/https://files.realpython.com/media/pythonlogo.0658b34b4498.jpg 170w, /cdn-cgi/image/width=226,format=auto/https://files.realpython.com/media/pythonlogo.0658b34b4498.jpg 226w, /cdn-cgi/image/width=340,format=auto/https://files.realpython.com/media/pythonlogo.0658b34b4498.jpg 340w, /cdn-cgi/image/width=680,format=auto/https://files.realpython.com/media/pythonlogo.0658b34b4498.jpg 680w&quot; sizes=&quot;(min-width: 1200px) 690px, (min-width: 780px) calc(-5vw + 669px), (min-width: 580px) 510px, calc(100vw - 30px)&quot; alt=&quot;The Python Logo. The Python logo is a trademark of the Python Software Foundation.&quot; data-asset=&quot;183&quot;&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;&lt;a href=&quot;/ref/glossary/python/&quot; class=&quot;ref-link&quot;&gt;&lt;strong&gt;Python&lt;/strong&gt;&lt;/a&gt; is a &lt;strong&gt;high-level&lt;/strong&gt;, &lt;strong&gt;interpreted&lt;/strong&gt;, &lt;strong&gt;interactive&lt;/strong&gt;, and &lt;strong&gt;object-oriented&lt;/strong&gt; programming language that’s a great choice as a first language because its code reads like English. It’s flexible, powerful, and allows you to do many things, both big and small.&lt;/p&gt;
&lt;p&gt;With Python, you can write basic programs and &lt;a href=&quot;https://realpython.com/run-python-scripts/&quot;&gt;scripts&lt;/a&gt;, as well as create complex and large-scale enterprise solutions. Here’s a sampling of its uses:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Building desktop applications, including &lt;a href=&quot;https://realpython.com/learning-paths/python-gui-programming/&quot;&gt;GUI applications&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/command-line-interfaces-python-argparse/&quot;&gt;CLI tools&lt;/a&gt;, and even &lt;a href=&quot;https://realpython.com/top-python-game-engines/&quot;&gt;games&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Doing &lt;a href=&quot;https://realpython.com/learning-paths/math-data-science/&quot;&gt;mathematical&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/learning-paths/data-science-python-core-skills/&quot;&gt;scientific&lt;/a&gt; data analysis&lt;/li&gt;
&lt;li&gt;Building &lt;a href=&quot;https://realpython.com/learning-paths/become-python-web-developer/&quot;&gt;web&lt;/a&gt; applications&lt;/li&gt;
&lt;li&gt;Administering computer systems and automating tasks&lt;/li&gt;
&lt;li&gt;Performing &lt;a href=&quot;https://realpython.com/tutorials/devops/&quot;&gt;DevOps&lt;/a&gt; tasks&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; To learn more about the tasks you can perform with Python, check out the &lt;a href=&quot;https://realpython.com/what-can-i-do-with-python/&quot;&gt;What Can I Do With Python?&lt;/a&gt; tutorial.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;You’ll find Python across many high-traffic websites. For example, &lt;a href=&quot;https://www.reddit.com/&quot;&gt;Reddit&lt;/a&gt; is written in Python. Dropbox’s earliest prototypes were in Python, and it remains central there. YouTube uses Python among its back-end languages. Meanwhile, Instagram runs on &lt;a href=&quot;https://realpython.com/learning-paths/django-web-development/&quot;&gt;Django&lt;/a&gt;, and Pinterest has historically used Python with a modified Django stack.&lt;/p&gt;
&lt;p&gt;Python offers many features that make it attractive as your first programming language:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Readable, beginner-friendly syntax&lt;/strong&gt;: Python’s design favors code readability, so you spend more time learning programming ideas and less time fighting syntax.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Accessible&lt;/strong&gt;: People of all ages, from school children to retirees, have learned Python, and so can you.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Batteries included&lt;/strong&gt;: The standard library ships with modules for file processing, networking, mathematics, date and time processing, testing, and more.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Large community and abundant resources&lt;/strong&gt;: There’s a vast ecosystem of tutorials, videos, forums, and local meetups for every topic and skill level.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Proven in the real world&lt;/strong&gt;: From startups to enterprises and research labs, Python powers production systems, data pipelines, and AI tooling across industries.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Versatile and scalable&lt;/strong&gt;: It can be used for quick scripts and automation, as well as web applications, data analysis, machine learning, and even game development.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Free and cross-platform&lt;/strong&gt;: Python runs on Windows, macOS, and Linux, and it’s free for both personal and commercial use.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Open source&lt;/strong&gt;: Python source code is publicly available under the &lt;a href=&quot;https://docs.python.org/3/license.html?utm_source=chatgpt.com#python-software-foundation-license-version-2&quot;&gt;Python Software Foundation License Version 2&lt;/a&gt;, which grants broad rights to use, modify, and distribute, including in proprietary software. Additionally, anyone can &lt;a href=&quot;https://realpython.com/start-contributing-python/&quot;&gt;contribute to its development&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Compared to other programming languages, Python offers several key features:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Interpreted:&lt;/strong&gt; It’s portable and quicker to experiment with than compiled languages.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Multiparadigm:&lt;/strong&gt; It lets you write code in different styles, including &lt;a href=&quot;https://realpython.com/python3-object-oriented-programming/&quot;&gt;object-oriented&lt;/a&gt;, &lt;a href=&quot;https://en.wikipedia.org/wiki/Imperative_programming&quot;&gt;imperative&lt;/a&gt;, and &lt;a href=&quot;https://realpython.com/python-functional-programming/&quot;&gt;functional&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Dynamically typed:&lt;/strong&gt; It checks variable types at runtime, so you don’t need to declare them explicitly.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Strongly typed:&lt;/strong&gt; It won’t let unsafe operations on incompatible types go unnoticed.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There’s a lot more to learn about Python. But by now, you should have a better idea of why Python is so popular and why you should consider learning to program with it.&lt;/p&gt;
&lt;h2 id=&quot;how-do-you-install-and-run-python&quot;&gt;How Do You Install and Run Python?&lt;a class=&quot;headerlink&quot; href=&quot;#how-do-you-install-and-run-python&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Before you can learn how to use Python, you need to install it. Python works on Linux, macOS, &lt;a href=&quot;https://realpython.com/python-coding-setup-windows/&quot;&gt;Windows&lt;/a&gt;, and several other platforms. You can download and install the latest version from the official &lt;a href=&quot;https://www.python.org/downloads/&quot;&gt;download page&lt;/a&gt;. You also have the option to install and use &lt;a href=&quot;https://realpython.com/intro-to-pyenv/&quot;&gt;different Python versions&lt;/a&gt; for different projects.&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; For a complete guide on installing Python on your computer, check out the &lt;a href=&quot;https://realpython.com/installing-python/&quot;&gt;How to Install Python on Your System: A Guide&lt;/a&gt; tutorial.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;To check what Python version has been installed globally on your operating system, open the &lt;a href=&quot;https://realpython.com/terminal-commands/&quot;&gt;terminal&lt;/a&gt; or command line and run the following:&lt;/p&gt;
&lt;ul class=&quot;nav nav-tabs justify-content-end js-platform-widget-tabs&quot; role=&quot;tablist&quot;&gt;

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




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

&lt;/ul&gt;
&lt;div class=&quot;tab-content mt-2 mb-0 js-platform-widget-content&quot;&gt;
&lt;div aria-labelledby=&quot;windows-tab-1&quot; class=&quot;tab-pane fade show active&quot; id=&quot;windows-1&quot; role=&quot;tabpanel&quot;&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pscon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Windows PowerShell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;PS&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;py&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;-V&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;/div&gt;
&lt;div aria-labelledby=&quot;linux-macos-tab-1&quot; class=&quot;tab-pane fade &quot; id=&quot;linux-macos-1&quot; role=&quot;tabpanel&quot;&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python3&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;-V
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-first-steps/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-first-steps/ »&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>Quiz: How to Use Python: Your First Steps</title>
      <id>https://realpython.com/quizzes/python-first-steps/</id>
      <link href="https://realpython.com/quizzes/python-first-steps/"/>
      <updated>2025-10-13T12:00:00+00:00</updated>
      <summary>Review the basics of Python with this quiz. Practice syntax, keywords, variables, errors, and tools every beginner should know.</summary>
      <content type="html">
        &lt;p&gt;Ready to check your foundation in Python? This quiz reviews core beginner topics like variables, keywords, strings, and errors. You&amp;rsquo;ll also practice commands and tools that help you get started quickly.&lt;/p&gt;
&lt;p&gt;As you work through the questions, focus on recognizing patterns and understanding why an answer is correct. For a guided introduction, see &lt;a href=&quot;https://realpython.com/python-first-steps/&quot;&gt;How to Use Python: Your First Steps&lt;/a&gt;.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #269: Python 3.14: Exploring the New Features</title>
      <id>https://realpython.com/podcasts/rpp/269/</id>
      <link href="https://realpython.com/podcasts/rpp/269/"/>
      <updated>2025-10-10T12:00:00+00:00</updated>
      <summary>Python 3.14 is here! Christopher Trudeau returns to discuss the new version with Real Python team member Bartosz Zaczyński. This year, Bartosz coordinated the series of preview articles with members of the Real Python team and wrote the showcase tutorial, &quot;Python 3.14: Cool New Features for You to Try.&quot; Christopher&#x27;s video course, &quot;What&#x27;s New in Python 3.14&quot;, covers the topics from the article and shows the new features in action.</summary>
      <content type="html">
        &lt;p&gt;Python 3.14 is here! Christopher Trudeau returns to discuss the new version with Real Python team member Bartosz Zaczyński. This year, Bartosz coordinated the series of preview articles with members of the Real Python team and wrote the showcase tutorial, &quot;Python 3.14: Cool New Features for You to Try.&quot; Christopher&#x27;s video course, &quot;What&#x27;s New in Python 3.14&quot;, covers the topics from the article and shows the new features in action.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Python 3.14: Cool New Features for You to Try</title>
      <id>https://realpython.com/python314-new-features/</id>
      <link href="https://realpython.com/python314-new-features/"/>
      <updated>2025-10-08T14:00:00+00:00</updated>
      <summary>Learn what&#x27;s new in Python 3.14, including an upgraded REPL, template strings, lazy annotations, and subinterpreters, with examples to try in your code.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;&lt;a href=&quot;https://www.python.org/downloads/release/python-3140/&quot;&gt;Python 3.14&lt;/a&gt; was released on &lt;a href=&quot;https://peps.python.org/pep-0745/&quot;&gt;October 7, 2025&lt;/a&gt;. While many of its biggest changes happen under the hood, there are practical improvements you’ll notice right away. This version sharpens the language’s tools, boosts ergonomics, and opens doors to new capabilities without forcing you to rewrite everything.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll explore features like:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A smarter, more &lt;strong&gt;colorful REPL&lt;/strong&gt; experience&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Error messages&lt;/strong&gt; that guide you toward fixes&lt;/li&gt;
&lt;li&gt;Safer hooks for &lt;strong&gt;live debugging&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Template strings (&lt;strong&gt;t-strings&lt;/strong&gt;) for controlled interpolation&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Deferred annotation evaluation&lt;/strong&gt; to simplify typing&lt;/li&gt;
&lt;li&gt;New concurrency options like &lt;strong&gt;subinterpreters&lt;/strong&gt; and a &lt;strong&gt;free-threaded&lt;/strong&gt; build&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you want to try out the examples, make sure you run Python 3.14 or a compatible &lt;a href=&quot;https://realpython.com/python-pre-release/&quot;&gt;preview release&lt;/a&gt;.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; On Unix systems, when you create a new &lt;a href=&quot;https://realpython.com/python-virtual-environments-a-primer/&quot;&gt;virtual environment&lt;/a&gt; with the new Python 3.14, you’ll spot a quirky alias:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;𝜋thon
&lt;span class=&quot;go&quot;&gt;Python 3.14.0 (main, Oct  7 2025, 17:32:06) [GCC 14.2.0] on linux&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;This feature is exclusive to the 3.14 release as a tribute to the mathematical constant &lt;a href=&quot;https://en.wikipedia.org/wiki/Pi&quot;&gt;π (pi)&lt;/a&gt;, whose rounded value, 3.14, is familiar to most people.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;As you read on, you’ll find detailed examples and explanations for each feature. Along the way, you’ll get tips on how they can streamline your coding today and prepare you for what’s coming next.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python314-new-features-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python314-new-features-code&quot; markdown&gt;Click here to download the free sample code&lt;/a&gt; that you’ll use to learn about the new features in Python 3.14.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;container border rounded text-wrap-pretty my-3&quot;&gt;

  &lt;p class=&quot;my-3&quot;&gt;&lt;mark class=&quot;marker-highlight&quot;&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt;&lt;/mark&gt; Test your knowledge with our interactive “Python 3.14: Cool New Features for You to Try” quiz. You’ll receive a score upon completion to help you track your learning progress:&lt;/p&gt;

  &lt;hr&gt;

  &lt;div class=&quot;row my-3&quot;&gt;
    &lt;div class=&quot;col-xs-12 col-sm-4 col-md-3 align-self-center&quot;&gt;

      &lt;a href=&quot;/quizzes/python314-new-features/&quot; tabindex=&quot;-1&quot;&gt;
        &lt;div class=&quot;embed-responsive embed-responsive-16by9&quot;&gt;

            &lt;img class=&quot;card-img-top m-0 p-0 embed-responsive-item rounded&quot; style=&quot;object-fit: contain; background: #e5c6aa;&quot; alt=&quot;Python 3.14: Cool New Features for You to Try&quot; src=&quot;https://files.realpython.com/media/Python-3.14-Cool-New-Features_Watermarked.1f256aff1d4b.jpg&quot; width=&quot;1920&quot; height=&quot;1080&quot; srcset=&quot;/cdn-cgi/image/width=480,format=auto/https://files.realpython.com/media/Python-3.14-Cool-New-Features_Watermarked.1f256aff1d4b.jpg 480w, /cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/Python-3.14-Cool-New-Features_Watermarked.1f256aff1d4b.jpg 640w, /cdn-cgi/image/width=960,format=auto/https://files.realpython.com/media/Python-3.14-Cool-New-Features_Watermarked.1f256aff1d4b.jpg 960w, /cdn-cgi/image/width=1920,format=auto/https://files.realpython.com/media/Python-3.14-Cool-New-Features_Watermarked.1f256aff1d4b.jpg 1920w&quot; sizes=&quot;(min-width: 1200px) 142px, (min-width: 1000px) 122px, (min-width: 780px) 112px, (min-width: 580px) 139px, calc(100vw - 62px)&quot;&gt;


          &lt;div class=&quot;card-img-overlay d-flex align-items-center&quot;&gt;
            &lt;div class=&quot;mx-auto&quot;&gt;
              &lt;span class=&quot;text-light&quot; style=&quot;opacity: 0.90;&quot;&gt;&lt;span class=&quot;icon baseline scale2x&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/a&gt;

    &lt;/div&gt;
    &lt;div class=&quot;col&quot;&gt;
      &lt;div class=&quot;mt-3 d-md-none&quot;&gt;&lt;/div&gt; 
      &lt;p class=&quot;small text-muted mb-0&quot;&gt;&lt;strong&gt;Interactive Quiz&lt;/strong&gt;&lt;/p&gt;
      &lt;a href=&quot;/quizzes/python314-new-features/&quot; class=&quot;stretched-link&quot;&gt;&lt;span class=&quot;my-0 h4&quot;&gt;Python 3.14: Cool New Features for You to Try&lt;/span&gt;&lt;/a&gt; 
      &lt;p class=&quot;text-muted mb-0 small&quot;&gt;In this quiz, you&#x27;ll test your understanding of the new features introduced in Python 3.14. By working through this quiz, you&#x27;ll review the key updates and improvements in this version of Python.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;/div&gt;

&lt;h2 id=&quot;developer-experience-improvements&quot;&gt;Developer Experience Improvements&lt;a class=&quot;headerlink&quot; href=&quot;#developer-experience-improvements&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Python 3.14 continues the trend of refining the language’s ergonomics. This release enhances the built-in interactive shell with live syntax highlighting and smarter autocompletion. It also improves syntax and runtime error messages, making them clearer and more actionable. While these upgrades don’t change the language itself, they boost your productivity as you write, test, and debug code.&lt;/p&gt;
&lt;h3 id=&quot;even-friendlier-python-repl&quot;&gt;Even Friendlier Python REPL&lt;a class=&quot;headerlink&quot; href=&quot;#even-friendlier-python-repl&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Python’s interactive interpreter, also known as the &lt;a href=&quot;/ref/glossary/repl/&quot; class=&quot;ref-link&quot;&gt;REPL&lt;/a&gt;, has always been the quickest way to try out a snippet of code, &lt;a href=&quot;/ref/glossary/debugging/&quot; class=&quot;ref-link&quot;&gt;debug&lt;/a&gt; an issue, or explore a third-party library. It can even serve as a handy calculator or a bare-bones data analysis tool. Although your mileage may vary, you typically start the REPL by running the &lt;code&gt;python&lt;/code&gt; command in your &lt;a href=&quot;https://realpython.com/terminal-commands/&quot;&gt;terminal&lt;/a&gt; without passing any arguments:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python
&lt;span class=&quot;go&quot;&gt;Python 3.14.0 (main, Oct  7 2025, 17:32:06) [GCC 14.2.0] on linux&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;The humble prompt, which consists of three chevrons (&lt;code&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/code&gt;), invites you to type a Python &lt;a href=&quot;/ref/glossary/statement/&quot; class=&quot;ref-link&quot;&gt;statement&lt;/a&gt; or an &lt;a href=&quot;/ref/glossary/expression/&quot; class=&quot;ref-link&quot;&gt;expression&lt;/a&gt; for immediate evaluation. As soon as you press &lt;span class=&quot;keys&quot;&gt;&lt;kbd class=&quot;key-enter&quot;&gt;Enter&lt;/kbd&gt;&lt;/span&gt;, you’ll instantly see the computed result without having to create any source files or configure a project workspace. After each result, the familiar prompt returns, ready to accept your next command:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; role=&quot;button&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&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;go&quot;&gt;4&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.0fae35ff985f.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;For years, the stock &lt;a href=&quot;https://realpython.com/python-repl/&quot;&gt;Python REPL&lt;/a&gt; remained intentionally minimal. It was fast and reliable, but lacked the polish of alternative shells built by the community, like &lt;a href=&quot;https://realpython.com/ipython-interactive-python-shell/&quot;&gt;IPython&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/ptpython-shell/&quot;&gt;ptpython&lt;/a&gt;, or &lt;a href=&quot;https://realpython.com/bpython-alternative-python-repl/&quot;&gt;bpython&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;That started to change in &lt;a href=&quot;https://realpython.com/python313-new-features/&quot;&gt;Python 3.13&lt;/a&gt;, which adopted a &lt;a href=&quot;https://realpython.com/python313-repl/&quot;&gt;modern REPL&lt;/a&gt; based on &lt;a href=&quot;https://github.com/pypy/pyrepl&quot;&gt;PyREPL&lt;/a&gt; borrowed from the &lt;a href=&quot;https://realpython.com/pypy-faster-python/&quot;&gt;PyPy&lt;/a&gt; project. This upgrade introduced multiline editing, smarter history browsing, and improved &lt;span class=&quot;keys&quot;&gt;&lt;kbd class=&quot;key-tab&quot;&gt;Tab&lt;/kbd&gt;&lt;/span&gt; completion, while keeping the simplicity of the classic REPL.&lt;/p&gt;
&lt;p&gt;Python 3.14 takes the interactive shell experience to the next level, introducing two new features:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Syntax highlighting:&lt;/strong&gt; Real-time syntax highlighting with configurable color themes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Code completion:&lt;/strong&gt; Autocompletion of module names inside &lt;code&gt;import&lt;/code&gt; statements&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Together, these improvements make the built-in REPL feel closer to a full-fledged &lt;a href=&quot;https://realpython.com/python-ides-code-editors-guide/&quot;&gt;code editor&lt;/a&gt; while keeping it lightweight and always available. The Python REPL now highlights code as you type. &lt;a href=&quot;https://realpython.com/python-keywords/&quot;&gt;Keywords&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-strings/&quot;&gt;strings&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-comments-guide/&quot;&gt;comments&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-numbers/&quot;&gt;numbers&lt;/a&gt;, and &lt;a href=&quot;https://realpython.com/python-operators-expressions/&quot;&gt;operators&lt;/a&gt; each get their own color, using &lt;a href=&quot;https://en.wikipedia.org/wiki/ANSI_escape_code&quot;&gt;ANSI escape codes&lt;/a&gt; similar to those that already color &lt;a href=&quot;https://docs.python.org/3/glossary.html#term-0&quot;&gt;prompts&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/python-traceback/&quot;&gt;tracebacks&lt;/a&gt; in Python 3.13:&lt;/p&gt;
&lt;figure&gt;
  &lt;div class=&quot;embed-responsive embed-responsive-16by9 rounded mb-3 &quot;&gt;
    &lt;iframe loading=&quot;lazy&quot; class=&quot;embed-responsive-item&quot; src=&quot;https://player.vimeo.com/video/1122576168?background=1&quot; frameborder=&quot;0&quot; allow=&quot;fullscreen&quot; allowfullscreen&gt;&lt;/iframe&gt;
  &lt;/div&gt;
  &lt;figcaption class=&quot;figure-caption text-center&quot;&gt;Python 3.14 Syntax Highlighting in the REPL&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;Notice how the colors shift as you type, once the interactive shell has enough context to parse your input. In particular, tokens such as the &lt;a href=&quot;/ref/keywords/underscore/&quot; class=&quot;ref-link&quot;&gt;underscore (&lt;code&gt;_&lt;/code&gt;)&lt;/a&gt; are recognized as &lt;a href=&quot;/ref/glossary/soft-keyword/&quot; class=&quot;ref-link&quot;&gt;soft keywords&lt;/a&gt; only in the context of &lt;a href=&quot;https://realpython.com/structural-pattern-matching/&quot;&gt;pattern matching&lt;/a&gt;, and Python highlights them in a distinct color to set them apart. This colorful output also shows up in the &lt;a href=&quot;https://realpython.com/python-debugging-pdb/&quot;&gt;Python debugger (pdb)&lt;/a&gt; when you set a &lt;a href=&quot;/ref/builtin-functions/breakpoint/&quot; class=&quot;ref-link&quot;&gt;&lt;code&gt;breakpoint()&lt;/code&gt;&lt;/a&gt; on a given line of code, for example.&lt;/p&gt;
&lt;p&gt;Additionally, a few of the &lt;a href=&quot;/ref/glossary/standard-library/&quot; class=&quot;ref-link&quot;&gt;standard-library&lt;/a&gt; modules can now take advantage of this new syntax-coloring capability of the Python interpreter:&lt;/p&gt;
&lt;figure&gt;
  &lt;div class=&quot;embed-responsive embed-responsive-16by9 rounded mb-3 &quot;&gt;
    &lt;iframe loading=&quot;lazy&quot; class=&quot;embed-responsive-item&quot; src=&quot;https://player.vimeo.com/video/1122581196?background=1&quot; frameborder=&quot;0&quot; allow=&quot;fullscreen&quot; allowfullscreen&gt;&lt;/iframe&gt;
  &lt;/div&gt;
  &lt;figcaption class=&quot;figure-caption text-center&quot;&gt;Colorful Output in Python 3.14&#x27;s Standard-Library Modules&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;The &lt;a href=&quot;https://realpython.com/command-line-interfaces-python-argparse/&quot;&gt;&lt;code&gt;argparse&lt;/code&gt;&lt;/a&gt; module displays a colorful help message, the &lt;a href=&quot;https://realpython.com/python-calendar-module/&quot;&gt;&lt;code&gt;calendar&lt;/code&gt;&lt;/a&gt; module highlights the current day, the &lt;a href=&quot;https://realpython.com/python-json/&quot;&gt;&lt;code&gt;json&lt;/code&gt;&lt;/a&gt; module &lt;a href=&quot;https://realpython.com/python-pretty-print/&quot;&gt;pretty-prints&lt;/a&gt; and colorizes &lt;a href=&quot;/ref/glossary/json/&quot; class=&quot;ref-link&quot;&gt;JSON&lt;/a&gt; documents. Finally, the &lt;a href=&quot;https://realpython.com/python-unittest/&quot;&gt;&lt;code&gt;unittest&lt;/code&gt;&lt;/a&gt; module provides a colorful output for failed &lt;a href=&quot;https://realpython.com/python-assert-statement/&quot;&gt;assertions&lt;/a&gt; to make reading and diagnosing them easier.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python314-new-features/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python314-new-features/ »&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>Quiz: Python 3.14: Cool New Features for You to Try</title>
      <id>https://realpython.com/quizzes/python314-new-features/</id>
      <link href="https://realpython.com/quizzes/python314-new-features/"/>
      <updated>2025-10-08T12:00:00+00:00</updated>
      <summary>In this quiz, you&#x27;ll test your understanding of the new features introduced in Python 3.14. By working through this quiz, you&#x27;ll review the key updates and improvements in this version of Python.</summary>
      <content type="html">
        &lt;p&gt;In this quiz, you&amp;rsquo;ll test your understanding of
&lt;a href=&quot;https://realpython.com/python314-new-features/&quot;&gt;Python 3.14: Cool New Features for You to Try&lt;/a&gt;. By working through this quiz, you&amp;rsquo;ll review the key updates and improvements in this version of Python.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>What&#x27;s New in Python 3.14</title>
      <id>https://realpython.com/courses/whats-new-python-314/</id>
      <link href="https://realpython.com/courses/whats-new-python-314/"/>
      <updated>2025-10-07T14:00:00+00:00</updated>
      <summary>Covers Python 3.14&#x27;s key changes: free-threading, subinterpreters, t-strings, lazy annotations, new REPL features, and improved error messages.</summary>
      <content type="html">
        &lt;p&gt;Python 3.14 was published on &lt;a href=&quot;https://peps.python.org/pep-0745/&quot;&gt;October 7, 2025&lt;/a&gt;. While many of its biggest changes happen under the hood, there are practical improvements you&amp;rsquo;ll notice right away. This version sharpens the language&amp;rsquo;s tools, boosts ergonomics, and opens doors to new capabilities without forcing you to rewrite everything.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this video course, you&amp;rsquo;ll explore features like:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A smarter, more &lt;strong&gt;colorful REPL&lt;/strong&gt; experience&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Error messages&lt;/strong&gt; that guide you toward fixes&lt;/li&gt;
&lt;li&gt;Safer hooks for &lt;strong&gt;live debugging&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Template strings (&lt;strong&gt;t-strings&lt;/strong&gt;) for controlled interpolation&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Deferred annotation evaluation&lt;/strong&gt; to simplify typing&lt;/li&gt;
&lt;li&gt;New concurrency options like &lt;strong&gt;subinterpreters&lt;/strong&gt; and a &lt;strong&gt;free-threaded&lt;/strong&gt; build&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 #268: Advice on Beginning to Learn Python</title>
      <id>https://realpython.com/podcasts/rpp/268/</id>
      <link href="https://realpython.com/podcasts/rpp/268/"/>
      <updated>2025-10-03T12:00:00+00:00</updated>
      <summary>What&#x27;s changed about learning Python over the last few years? What new techniques and updated advice should beginners have as they start their journey? This week on the show, Stephen Gruppetta and Martin Breuss return to discuss beginning to learn Python.</summary>
      <content type="html">
        &lt;p&gt;What&#x27;s changed about learning Python over the last few years? What new techniques and updated advice should beginners have as they start their journey? This week on the show, Stephen Gruppetta and Martin Breuss return to discuss beginning to learn Python.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Quiz: Python MCP Server: Connect LLMs to Your Data</title>
      <id>https://realpython.com/quizzes/python-mcp/</id>
      <link href="https://realpython.com/quizzes/python-mcp/"/>
      <updated>2025-10-01T12:00:00+00:00</updated>
      <summary>Test your knowledge of Python MCP. Practice installation, tools, resources, transports, and how LLMs interact with MCP servers.</summary>
      <content type="html">
        &lt;p&gt;This quiz helps you review the core ideas behind the Model Context Protocol (MCP). You will practice how MCP connects large language models with external systems, how to install it, and what role prompts, resources, and tools play.&lt;/p&gt;
&lt;p&gt;You&amp;rsquo;ll also revisit best practices for defining tools, explore client-server setups like Cursor, and check your understanding of transports and testing. For a full walkthrough, see &lt;a href=&quot;https://realpython.com/python-mcp/&quot;&gt;Python MCP Server: Connect LLMs to Your Data&lt;/a&gt;.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Quiz: Python 3.14 Preview: Better Syntax Error Messages</title>
      <id>https://realpython.com/quizzes/python314-error-messages/</id>
      <link href="https://realpython.com/quizzes/python314-error-messages/"/>
      <updated>2025-10-01T12:00:00+00:00</updated>
      <summary>Explore how Python 3.14 improves error messages with clearer explanations, actionable hints, and better debugging support for developers.</summary>
      <content type="html">
        &lt;p&gt;This quiz helps you get familiar with the upgraded error messages in &lt;a href=&quot;https://realpython.com/python314-error-messages/&quot;&gt;Python 3.14&lt;/a&gt;. You&amp;rsquo;ll review new keyword typo suggestions, improved math errors, string prefix feedback, and more.&lt;/p&gt;
&lt;p&gt;Put your understanding to the test and discover how Python&amp;rsquo;s improved error messages can help you debug code faster.&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>Modern Python Linting With Ruff</title>
      <id>https://realpython.com/courses/modern-python-linting-ruff/</id>
      <link href="https://realpython.com/courses/modern-python-linting-ruff/"/>
      <updated>2025-09-30T14:00:00+00:00</updated>
      <summary>Ruff is a blazing-fast, modern Python linter with a simple interface that can replace Pylint, isort, and Black—and it&#x27;s rapidly becoming popular.</summary>
      <content type="html">
        &lt;p&gt;Linting is essential to writing &lt;strong&gt;clean and readable code&lt;/strong&gt; that you can share with others. A linter, like Ruff, is a tool that analyzes your code and looks for errors, stylistic issues, and suspicious constructs. Linting allows you to address issues and &lt;a href=&quot;https://realpython.com/python-code-quality/&quot;&gt;improve your code quality&lt;/a&gt; before you &lt;a href=&quot;https://realpython.com/python-git-github-intro/#committing-changes&quot;&gt;commit&lt;/a&gt; your code and share it with others. &lt;/p&gt;
&lt;p&gt;Ruff is a modern linter that&amp;rsquo;s extremely fast and has a simple interface, making it straightforward to use. It also aims to be a drop-in replacement for many other linting and formatting tools, such as &lt;a href=&quot;https://github.com/PyCQA/flake8&quot;&gt;Flake8&lt;/a&gt;, &lt;a href=&quot;https://github.com/PyCQA/isort&quot;&gt;isort&lt;/a&gt;, and &lt;a href=&quot;https://github.com/psf/black&quot;&gt;Black&lt;/a&gt;. It&amp;rsquo;s quickly becoming one of the most popular Python linters.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this video course, you&amp;rsquo;ll learn how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Install &lt;strong&gt;Ruff&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Check your Python code&lt;/strong&gt; for errors&lt;/li&gt;
&lt;li&gt;Automatically &lt;strong&gt;fix your linting errors&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Use Ruff to &lt;strong&gt;format your code&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Add optional configurations&lt;/strong&gt; to supercharge your linting&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>Quiz: Modern Python Linting With Ruff</title>
      <id>https://realpython.com/quizzes/modern-python-linting-ruff/</id>
      <link href="https://realpython.com/quizzes/modern-python-linting-ruff/"/>
      <updated>2025-09-30T12:00:00+00:00</updated>
      <summary>Test your Ruff skills in a quick quiz. Practice installation checks, continuous linting, formatting, rule selection, auto-fixes, and config.</summary>
      <content type="html">
        &lt;p&gt;Sharpen your code quality workflow with Ruff. In this quiz, you&amp;rsquo;ll review installation checks, continuous linting, and code formatting.&lt;/p&gt;
&lt;p&gt;You&amp;rsquo;ll also revisit selecting rule codes, reading rule docs, applying safe fixes, and configuring TOML files. For a refresher, see &lt;a href=&quot;https://realpython.com/courses/modern-python-linting-ruff/&quot;&gt;Modern Python Linting With Ruff&lt;/a&gt;.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #267: Managing Feature Flags &amp; Comparing Python Visualization Libraries</title>
      <id>https://realpython.com/podcasts/rpp/267/</id>
      <link href="https://realpython.com/podcasts/rpp/267/"/>
      <updated>2025-09-26T12:00:00+00:00</updated>
      <summary>What&#x27;s a good way to enable or disable code paths without redeploying the software? How can you use feature flags to toggle functionality for specific users of your application? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;What&#x27;s a good way to enable or disable code paths without redeploying the software? How can you use feature flags to toggle functionality for specific users of your application? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Strip Characters From a Python String</title>
      <id>https://realpython.com/courses/strip-characters-from-string/</id>
      <link href="https://realpython.com/courses/strip-characters-from-string/"/>
      <updated>2025-09-23T14:00:00+00:00</updated>
      <summary>Use Python&#x27;s .strip() to remove whitespace or chosen chars. Learn pitfalls, real-world cases, and compare with .lstrip() and .removesuffix().</summary>
      <content type="html">
        &lt;p&gt;By default, Python&amp;rsquo;s &lt;code&gt;.strip()&lt;/code&gt; method removes whitespace characters from both ends of a string. To remove different characters, you can pass a string as an argument that specifies a set of characters to remove. The &lt;code&gt;.strip()&lt;/code&gt; method is useful for tasks like cleaning user input, standardizing filenames, and preparing data for storage.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this video course, you&amp;rsquo;ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;.strip()&lt;/code&gt; method &lt;strong&gt;removes leading and trailing whitespace&lt;/strong&gt; but doesn&amp;rsquo;t remove whitespace from the middle of a string.&lt;/li&gt;
&lt;li&gt;You can use &lt;code&gt;.strip()&lt;/code&gt; to remove &lt;strong&gt;specified characters&lt;/strong&gt; from both ends of the string by providing these characters as an &lt;strong&gt;argument&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;With the related methods &lt;strong&gt;&lt;code&gt;.lstrip()&lt;/code&gt; and &lt;code&gt;.rstrip()&lt;/code&gt;&lt;/strong&gt;, you can remove characters from &lt;strong&gt;one side&lt;/strong&gt; of the string only.&lt;/li&gt;
&lt;li&gt;All three methods, &lt;code&gt;.strip()&lt;/code&gt;, &lt;code&gt;.lstrip()&lt;/code&gt;, and &lt;code&gt;.rstrip()&lt;/code&gt;, &lt;strong&gt;remove character sets, not sequences&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;You can use &lt;strong&gt;&lt;code&gt;.removeprefix()&lt;/code&gt; and &lt;code&gt;.removesuffix()&lt;/code&gt;&lt;/strong&gt; to &lt;strong&gt;strip character sequences&lt;/strong&gt; from the start or end of a string.&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 #266: Dangers of Automatically Converting a REST API to MCP</title>
      <id>https://realpython.com/podcasts/rpp/266/</id>
      <link href="https://realpython.com/podcasts/rpp/266/"/>
      <updated>2025-09-19T12:00:00+00:00</updated>
      <summary>When converting an existing REST API to the Model Context Protocol, what should you consider? What anti-patterns should you avoid to keep an AI agent’s context clean? This week on the show, Kyle Stratis returns to discuss his upcoming book, &quot;AI Agents with MCP&quot;.</summary>
      <content type="html">
        &lt;p&gt;When converting an existing REST API to the Model Context Protocol, what should you consider? What anti-patterns should you avoid to keep an AI agent’s context clean? This week on the show, Kyle Stratis returns to discuss his upcoming book, &quot;AI Agents with MCP&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 Project Management With uv</title>
      <id>https://realpython.com/courses/python-project-management-with-uv/</id>
      <link href="https://realpython.com/courses/python-project-management-with-uv/"/>
      <updated>2025-09-16T14:00:00+00:00</updated>
      <summary>Create and manage Python projects with uv, a blazing-fast package and project manager built in Rust. Learn setup, workflow, and best practices.</summary>
      <content type="html">
        &lt;p&gt;The &lt;code&gt;uv&lt;/code&gt; tool is a high-speed package and project manager for Python. It&amp;rsquo;s written in Rust and designed to streamline your workflow. It offers fast dependency installation and integrates various functionalities into a single tool.&lt;/p&gt;
&lt;p&gt;With &lt;code&gt;uv&lt;/code&gt;, you can install and manage multiple Python versions, create virtual environments, efficiently handle project dependencies, reproduce working environments, and even build and publish a project. These capabilities make &lt;code&gt;uv&lt;/code&gt; an all-in-one tool for Python project management.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this video course, you&amp;rsquo;ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;uv&lt;/code&gt; is a Python package and project manager&lt;/strong&gt; that integrates multiple functionalities into one tool, offering a comprehensive solution for managing Python projects.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;uv&lt;/code&gt; is used for fast dependency installation&lt;/strong&gt;, virtual environment management, Python version management, and project initialization, enhancing productivity and efficiency.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;uv&lt;/code&gt; can build and publish Python packages&lt;/strong&gt; to package repositories like PyPI, supporting a streamlined process from development to distribution.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;uv&lt;/code&gt; automatically handles virtual environments&lt;/strong&gt;, creating and managing them as needed to ensure clean and isolated project dependencies.&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 #265: Python App Hosting Choices &amp; Documenting Python&#x27;s History</title>
      <id>https://realpython.com/podcasts/rpp/265/</id>
      <link href="https://realpython.com/podcasts/rpp/265/"/>
      <updated>2025-09-12T12:00:00+00:00</updated>
      <summary>What are your options for hosting your Python application or scripts? What are the advantages of a platform as a service, container-based hosts, or setting up a virtual machine? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;What are your options for hosting your Python application or scripts? What are the advantages of a platform as a service, container-based hosts, or setting up a virtual machine? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Python String Splitting</title>
      <id>https://realpython.com/courses/python-string-splitting/</id>
      <link href="https://realpython.com/courses/python-string-splitting/"/>
      <updated>2025-09-09T14:00:00+00:00</updated>
      <summary>Master Python string splitting with .split() and re.split() to handle whitespace, delimiters and multiline text.</summary>
      <content type="html">
        &lt;p&gt;Python&amp;rsquo;s &lt;code&gt;.split()&lt;/code&gt; method lets you divide a string into a list of substrings based on a specified delimiter. By default, &lt;code&gt;.split()&lt;/code&gt; separates at whitespace, including spaces, tabs, and newlines. You can customize &lt;code&gt;.split()&lt;/code&gt; to work with specific delimiters using the &lt;code&gt;sep&lt;/code&gt; parameter, and control the amount of splits with &lt;code&gt;maxsplit&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this video course, you&amp;rsquo;ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You &lt;strong&gt;split a string by spaces&lt;/strong&gt; in Python using &lt;strong&gt;&lt;code&gt;.split()&lt;/code&gt; without arguments&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Python&amp;rsquo;s &lt;code&gt;.split()&lt;/code&gt; method can split on &lt;strong&gt;custom delimiters&lt;/strong&gt; when you pass a character or string as an argument.&lt;/li&gt;
&lt;li&gt;You &lt;strong&gt;limit splits using &lt;code&gt;maxsplit&lt;/code&gt;&lt;/strong&gt; to control the number of substrings Python extracts.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;re.split()&lt;/code&gt; uses &lt;strong&gt;regular expressions&lt;/strong&gt; for splitting strings based on complex patterns.&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 #264: Large Language Models on the Edge of the Scaling Laws</title>
      <id>https://realpython.com/podcasts/rpp/264/</id>
      <link href="https://realpython.com/podcasts/rpp/264/"/>
      <updated>2025-09-05T12:00:00+00:00</updated>
      <summary>What&#x27;s happening with the latest releases of large language models? Is the industry hitting the edge of the scaling laws, and do the current benchmarks provide reliable performance assessments? This week on the show, Jodie Burchell returns to discuss the current state of LLM releases.</summary>
      <content type="html">
        &lt;p&gt;What&#x27;s happening with the latest releases of large language models? Is the industry hitting the edge of the scaling laws, and do the current benchmarks provide reliable performance assessments? This week on the show, Jodie Burchell returns to discuss the current state of LLM releases.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  

</feed>
