Python Scope and the LEGB Rule: Resolving Names in Your Code

The scope of a variable in Python determines where in your code that variable is visible and accessible. Python has four general scope levels: local, enclosing, global, and built-in. When searching for a name, Python goes through these scopes in order. It follows the LEGB rule, which stands for Local, Enclosing, Global, and Built-in. Understanding how Python manages the scope of variables and names is a fundamental skill for you as a Python developer. It helps you avoid unexpected behavior […]

Read more

Getting Started With marimo Notebooks

marimo notebooks redefine the notebook experience by offering a reactive environment that addresses the limitations of traditional linear notebooks. With marimo, you can seamlessly reproduce and share content while benefiting from automatic cell updates and a correct execution order. Discover how marimo’s features make it an ideal tool for documenting research and learning activities. By the end of this video course, you’ll understand that: marimo notebooks automatically update dependent cells, ensuring consistent results across your work. Reactivity allows marimo to […]

Read more

Quiz: How to Debug Common Python Errors

Interactive Quiz ⋅ 7 QuestionsBy Geir Arne Hjelle Share In this quiz, you’ll test your understanding of How to Debug Common Python Errors. Debugging means identifying, analyzing, and resolving issues in your Python code. You’ll revisit reading tracebacks, using print() for value tracking, setting breakpoints to pause execution, and writing tests to catch errors. Good luck! The quiz contains 7 questions and there is no time limit. You’ll get 1 point for each correct answer. At the end of the […]

Read more

How to Debug Common Python Errors

Python debugging involves identifying and fixing errors in your code using tools like tracebacks, print() calls, breakpoints, and tests. In this tutorial, you’ll learn how to interpret error messages, use print() to track variable values, and set breakpoints to pause execution and inspect your code’s behavior. You’ll also explore how writing tests can help prevent errors and ensure your code runs as expected. By the end of this tutorial, you’ll understand that: Debugging means identifying, analyzing, and resolving issues in […]

Read more

AI Testing and Evaluation: Learnings from cybersecurity

CIARAN MARTIN: Well, thanks so much for inviting me. It’s great to be here. SULLIVAN: Ciaran, before we get into some regulatory specifics, it’d be great to hear a little bit more about your origin story, and just take us to that day—who tapped you on the shoulder and said, “Ciaran, we need you to run a national cyber center! Do you fancy building one?” MARTIN: You could argue that I owe my job to Edward Snowden. Not an obvious […]

Read more

How AI will accelerate biomedical research and discovery

Daphne Koller is the CEO and founder of Insitro, a machine learning-driven drug discovery and development company that recently made news for its identification of a novel drug target for ALS and its collaboration with Eli Lilly to license Lilly’s biochemical delivery systems. Prior to founding Insitro, Daphne was the co-founder, co-CEO, and president of the online education platform Coursera. Noubar Afeyan is the founder and CEO of Flagship Pioneering, which creates biotechnology companies focused on transforming human health and […]

Read more

Quiz: What Is Python’s __init__.py For?

Interactive Quiz ⋅ 7 QuestionsBy Martin Breuss Share In this quiz, you’ll test your knowledge of Python’s __init__.py file. Understanding this file’s role will help you create more organized and reusable Python code. The quiz contains 7 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 score is 100%. Good luck! Related Resources

Read more

What Is Python’s __init__.py For?

Python’s special __init__.py file marks a directory as a regular Python package and allows you to import its modules. This file runs automatically the first time you import its containing package. You can use it to initialize package-level variables, define functions or classes, and structure the package’s namespace clearly for users. By the end of this tutorial, you’ll understand that: A directory without an __init__.py file becomes a namespace package, which behaves differently from a regular package and may cause […]

Read more

Exploring Protocols in Python

In Python, a protocol specifies the methods and attributes that a class must implement to be considered of a given type. Protocols are important in Python’s type hint system, which allows for static type checking through external tools, such as mypy, Pyright, and Pyre. Before there were protocols, these tools could only check for nominal subtyping based on inheritance. There was no way to check for structural subtyping, which relies on the internal structure of classes. This limitation affected Python’s […]

Read more

Free-Threaded Python Unleashed and Other Python News for July 2025

Last month was a watershed moment for Python. Python 3.14 beta 3, released mid-June, isn’t just another pre-release. It’s the first build in which the long-awaited free-threaded or “no-GIL” variant is officially supported. That’s right: a no-GIL Python is finally taking shape. The interpreter isn’t the only thing making headlines, though. Below you’ll find a curated tour of the latest Python developments, broken down by area so you can zero in on your favorite topic. Core Python Development CPython’s core […]

Read more
1 2 3 929