Python Syntax and Semantics - Keywords

Keywords

Python has the following keywords or reserved words; they cannot be used as identifiers.

  • and
  • as
  • assert
  • break
  • class
  • continue
  • def
  • del
  • elif
  • else
  • except
  • exec (changed to a built-in function in 3.x)
  • False (added in 3.x)
  • finally
  • for
  • from
  • global
  • if
  • import
  • in
  • is
  • lambda
  • None (added in 3.x)
  • nonlocal (added in 3.x)
  • not
  • or
  • pass
  • print (changed to a built-in function in 3.x)
  • raise
  • return
  • True (added in 3.x)
  • try
  • while
  • with
  • yield

As exec and print are functions as of Python 3 they are not reserved words anymore.

Read more about this topic:  Python Syntax And Semantics