What are Python Reserved words (Keywords) | Part-3

 

What are reserved words in Python

  • In Python, some words are reserved to represent some meaning or functionality. Such types of words are called reserved words.
  • Python has these 35 keywords or reserved words; they cannot be used as identifiers

There are 35 reserved keywords in Python programming language.

Note:

1. All Reserved words in Python contain only alphabet symbols.
2. Except for the following 3 reserved words, all contain only lower case alphabet symbols.
  • True 
  • False 
  • None

Code for keywords/reserved list

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

Post a Comment

0 Comments