python打印关键字列表
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.
要打印所有关键字的列表,我们使用“ keyword.kwlist ”,可以在导入“ keyword ”模块后使用它,它返回当前Python版本中可用的关键字列表。
In the below code, we are implementing a Python program to print the list of all keywords.
在下面的代码中,我们正在实现一个Python程序来打印所有关键字的列表 。
# Python program to print the list of all keywords
# importing the module
import keyword
# printing the keywords
print("Python keywords are...")
print(keyword.kwlist)
Output
输出量
Python keywords are...
['False',