1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

#0012 pythonの予約語

Posted at

## はじめに

予約語とは、プログラミング言語などの人工言語の仕様に定められている、開発者が付ける識別名として利用できない文字列のこと。予約語に挙げられた単語やフレーズは変数名や関数名などに使用することはできない。

参照

pythonで予約語の確認

Python 3.11.4 

>>> import keyword

>>> len(keyword.kwlist)
35

>>> print( *keyword.kwlist, sep="\n" )
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

終わりに

  • 馴染みのない予約語 -> 調べよう。
    • async
    • nonlocal
    • yield
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?