In this tutorials, we will see the list of Python Keywords. In Python some words are reserved to represent some meaning of functionality, such type of words are called as Python keywords or Python reserved words.
There are 33 keywords available in Python.
- True, False, None
- and, or, not, is
- if, elif, else
- while,for, break, continue, return, in, yield
- try, except, finally, raise, assert
- import, from, as, class, def, pass, global, nonloccal, lambda, del, with
- All keywords in python contains only alphabet symbols.
- Except True, False, None keywords, remaining all keywords are containing lower case alphabet symbols.
- All python keywords are case sensitive i.e True is not equalled to
We can see the all list of keywords in python by giving the below command on python shell.
>>> 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']
Happy Learning 🙂