Pythonの予約語
Pythonには予約語があります。
予約語と同じ名称を変数や関数名として使用することはできません。
予約語は以下のように確認できます。
1 2 3 4 5 6 |
>>> __import__('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'] >>> |