Quiz: Namespaces in Python

Interactive Quiz ⋅ 11 QuestionsBy Martin Breuss Share In this quiz, you’ll test your understanding of Namespaces in Python. You’ll revisit how Python organizes symbolic names and objects in namespaces, when Python creates a new namespace, how namespaces are implemented, and how variable scope determines symbolic name visibility. The quiz contains 11 questions and there is no time limit. You’ll get 1 point for each correct answer. At the end of the quiz, you’ll receive a total score. The maximum […]

Read more

Namespaces in Python

Watch Now This tutorial has a related video course created by the Real Python team. Watch it together with the written tutorial to deepen your understanding: Navigating Namespaces and Scope in Python A Python namespace is a mapping from names to objects. It works like a dictionary where keys are object names and values are the objects themselves. Namespaces organize variables and functions in a dedicated space, allowing you to use multiple instances of the same name without conflict, as […]

Read more

Using Python’s .__dict__ to Work With Attributes

Python’s .__dict__ is a special attribute in classes and instances that acts as a namespace, mapping attribute names to their corresponding values. You can use .__dict__ to inspect, modify, add, or delete attributes dynamically, which makes it a versatile tool for metaprogramming and debugging. In this tutorial, you’ll learn about using .__dict__ in various contexts, including classes, instances, and functions. You’ll also explore its role in inheritance with practical examples and comparisons to other tools for manipulating attributes. By the […]

Read more

Checking for Membership Using Python’s “in” and “not in” Operators

Python’s in and not in operators allow you to quickly check if a given value is or isn’t part of a collection of values. This type of check is generally known as a membership test in Python. Therefore, these operators are known as membership operators. By the end of this video course, you’ll understand that: The in operator in Python is a membership operator used to check if a value is part of a collection. You can write not in […]

Read more

Python News Roundup: April 2025

Last month brought significant progress toward Python 3.14, exciting news from PyCon US, notable community awards, and important updates to several popular Python libraries. In this news roundup, you’ll catch up on the latest Python 3.14.0a6 developments, discover which PEP has been accepted, celebrate record-breaking community support for PyCon travel grants, and explore recent updates to popular libraries. Let’s dive in! Python 3.14.0a6 Released on Pi Day The Python development team has rolled out the sixth alpha version of Python […]

Read more

Real-world healthcare AI development and deployment—at scale

[THEME MUSIC FADES]  The passage I read at the top there is from Chapter 7 of the book, “The Ultimate Paperwork Shredder.”   Paperwork plays a particularly important role in healthcare. It helps convey treatment information that supports patient care, and it’s also used to help demonstrate that providers are meeting regulatory responsibilities, among other things. But if we’re being honest, it’s taxing—for everyone—and it’s a big contributor to the burnout our clinicians are experiencing today. Carey, Zak, and I identified […]

Read more

Highlights from Machine Translation and Multilinguality in March 2025

EuroBERT: Scaling Multilingual Encoders for European Languages A large group of authors, mostly from CentraleSupélec in Paris and Instituto Técnico in Lisbon, released EuroBERT, a multilingual BERT model for European and major global languages. There is also a 2.1 B version, unusually large for encoder models. High-Dimensional Interlingual Representations of Large Language Models A print from the Hong Kong University of Science and Technology evaluates the sentence-level similarity of LLM hidden states across languages. It shows that the idea that […]

Read more

How to Strip Characters From a Python String

By default, Python’s .strip() 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 .strip() method is useful for tasks like cleaning user input, standardizing filenames, and preparing data for storage. By the end of this tutorial, you’ll understand that: The .strip() method removes leading and trailing whitespace but doesn’t remove whitespace from the middle of a string. You […]

Read more
1 5 6 7 8 9 926