December 2013
Intermediate to advanced
152 pages
2h 8m
English
CHAPTER 7
![]()
Keywords
Keywords are special reserved words that cannot be used as variable names. Keywords will change over time as Python versions change. Below is a short program that will allow you to obtain a list of keywords specific for your version of Python. It is written using Python 3.x syntax, but will work for version 2.7 as well.
Import keywordprint(keyword.kwlist)
List of Python Keywords
Below is a list of Python keywords, in alphabetical order, for version 2.7.1.
and as assert breakclass continue def delelif else except execfinally ...
Read now
Unlock full access