Python Keywords

Keywords in Python are pre-defined and reserved words. These words are defined by the Python creator. Every keyword has its own meaning, and has defined to perform particular task.

List of Python Keywords

Here are the list of Python keywords:

  1. and
  2. as
  3. assert
  4. break
  5. class
  6. continue
  7. def
  8. del
  9. elif
  10. else
  11. except
  12. False
  13. finally
  14. for
  15. from
  16. global
  17. if
  18. import
  19. in
  20. is
  21. lambda
  22. None
  23. nonlocal
  24. not
  25. or
  26. pass
  27. raise
  28. return
  29. True
  30. try
  31. while
  32. with
  33. yield

Note - Characters of all keywords are in lowercase except True, False, and None.

Can Keywords be Used as Identifiers ?

No, a keyword can not be used as an identifier in Python.

What is Difference Between Keyword and Identifier ?

Keywords are pre-defined by Python's creator, whereas identifiers are user-defined names given to variables, classes, functions etc.

Python Online Test


« Previous Tutorial Next Tutorial »