In [1]:
import keyword
import pprint

In [2]:
print(type(keyword.kwlist))


<class 'list'>

In [3]:
print(len(keyword.kwlist))


35

In [4]:
pprint.pprint(keyword.kwlist, compact=True)


['False', 'None', 'True', 'and', 'as', 'assert', 'async', 'await', 'break',
 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for',
 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not',
 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield']

In [5]:
print(keyword.kwlist[0])


False

In [6]:
print(type(keyword.kwlist[0]))


<class 'str'>

In [7]:
# True = 100
# SyntaxError: can't assign to keyword

In [8]:
print(keyword.iskeyword('None'))


True

In [9]:
print(keyword.iskeyword('none'))


False