Documentation

Type defined in library builtins

NameError

Python raises a name error, for example, when it encounters a name that has not previously been defined (and so it does not know what that name means).

Note that the text of the error message depends on the implementation. Different versions of Python and different checking tools will give slightly different messages.

Code
pring(42)
error
NameError: name 'pring' is not defined. Did you mean: 'print'?

Logo of PyTamaro

PyTamaro is a project created by the Lugano Computing Education Research Lab at the Software Institute of USI

Privacy PolicyPlatform Version a9143b0 (Sun, 14 Dec 2025 12:09:46 GMT)