파이썬 예약어 확인하기

라이언양 위키
둘러보기로 가기 검색하러 가기

파이썬에서 사용하는 키워드 목록을 출력하려면 아래와 같이 입력하면 된다.

>>> import keyword
>>> print(keyword.kwlist)

['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']