Reserved Words and Identifiers

Identifiers

  • Names used to identify variables, functions, classes, modules, etc.
  • May contain A-Z, a-z, 0-9, and _
  • Must start with a nonnumeric character.
  • Identifiers starting with _ have special meaning in Python (more later).

Python Reserved Words

and elif global or
assert else if pass
break except import print
class exec in raise
continue finally is return
def for lambda try
del from not while
  • Can't use these names as identifiers.
<<< O'Reilly OSCON 2000, Introduction to Python, Slide 28
July 17, 2000, beazley@cs.uchicago.edu
>>>