파이썬

파이썬 예약어

노베코딩 2022. 7. 19. 22:14

python 에서 예약어는 변수로 사용하면 안된다.

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