Skip to content

002 Keywords

Introduction

Keywords are reserved words in python and cannot be used as identifiers

print(keyword.kwlist) len(keyword.kwlist) # Python contains 36 keywords
'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']