Built-in Exceptions — Python 3 documentation#NameError

exception NameError

Raised when a local or global name is not found. This applies only to unqualified names. The associated value is an error message that includes the name that could not be found.

The optional name keyword-only argument sets the attribute:

Printed 2026-06-28.

(echo:: @ )