Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
Key words in English as keywords,
reserved words (reserved word)
reserved words, keywords, there is a specific meaning in the language and become part of the grammar of those words, the user can not then these words as a variable or procedure name to use.
Reserved words and keywords are the difference: Some reserved words may not be applied to the current grammar, the syntax may be used in the future. and
Python reserved word contained execute the following command to view:
>>> import keyword
>>> keyword.kwlist
['False', 'None', 'True', 'and', 'as', 'assert', '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']
** ** Python reserved word list
and | as |
---|---|
assert | break |
class | continue |
def | of the |
elif | else |
except | finally |
for | from |
False | global |
if | import |
in | is |
lambda | nonlocal |
not | None |
or | pass |
raise | return |
try | True |
while | with |
yield |