当前位置: 代码迷 >> 综合 >> python中33个保留字
  详细解决方案

python中33个保留字

热度:88   发布时间:2024-02-28 05:43:20.0

在变量命名时,python中有33个保留字是我们不能使用的。

import keywordfor kw in keyword.kwlist:print(kw)

输出:

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

 

  相关解决方案