To print the list of all keywords, we use "keyword.kwlist", which can be used after importing the "keyword" module, it returns a list of the keyword available in the current Python version.
In the below code, we are implementing a Python program to print the list of all keywords.
# Python program to print the list of all keywords
# importing the module
import keyword
# printing the keywords
print("Python keywords are...")
print(keyword.kwlist)
In the below code, we are implementing a Python program to print the list of all keywords.
Output
need an explanation for this answer? contact us directly to get an explanation for this answer