An interactive 8-question quiz testing knowledge of Python's LEGB (Local, Enclosing, Global, Built-in) scope resolution rule. Covers how Python resolves names across different scopes and how the `global` and `nonlocal` statements allow crossing scope boundaries.

1m read timeFrom realpython.com
Post cover image
Table of contents
Related ResourcesThe LEGB Rule & Understanding Python Scope

Sort: