how to list all keywords in python for the used version

Solutions on MaxInterview for how to list all keywords in python for the used version by the best coders in the world

showing results for - "how to list all keywords in python for the used version"
Jannik
21 Nov 2019
1>>> help("keywords")
2
3Here is a list of the Python keywords.  Enter any keyword to get more help.
4
5False               class               from                or
6None                continue            global              pass
7True                def                 if                  raise
8and                 del                 import              return
9as                  elif                in                  try
10assert              else                is                  while
11async               except              lambda              with
12await               finally             nonlocal            yield
13break               for                 not
14
Sergio
27 Sep 2016
1>>> import keyword
2>>> keyword.kwlist
3['False', 'None', 'True', 'and', 'as', 'assert', 'async', ...
4>>> len(keyword.kwlist)
535
6