Python的保留字是指由Python语言定义的一组特殊的关键字,它们有特定的含义和用途,不能作为变量、函数或其他标识符的名字。例如:
Python的保留字是指由Python语言定义的一组特殊的关键字,它们有特定的含义和用途,不能作为变量、函数或其他标识符的名字。例如:
import keyword
print(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']
本站系公益性非盈利分享网址,本文来自用户投稿,不代表边看边学立场,如若转载,请注明出处
评论列表(15条)