Skip to content

Instantly share code, notes, and snippets.

@NateWeiler
Last active March 9, 2021 07:22
Show Gist options
  • Save NateWeiler/7f9f335f8761e4857e6b8e2113954e50 to your computer and use it in GitHub Desktop.
Save NateWeiler/7f9f335f8761e4857e6b8e2113954e50 to your computer and use it in GitHub Desktop.
All the keywords in python

List of Keywords in Python

This provides a brief information on all keywords used in Python.

Keywords are the reserved words in Python. We cannot use a keyword as a variable name, function name or any other identifier.


Here's a list of all keywords in Python Programming

Keywords in Python programming language

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

The above keywords may get altered in different versions of Python. Some extra might get added or some might be removed. You can always get the list of keywords in your current version by typing the following in the prompt.



>>> import keyword
>>> print(keyword.kwlist)
['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']



Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment