Python Keywords List

 

Code Example


If someone ask you what are the keywords in python?

chill man, Wait... No need to memorize anything for that, So how we can get all the keywords in python.


Keywords are the reserved words in Python. We cannot use a keyword as a variable name, function name or any other identifier. They are used to define the syntax and structure of the Python language. In Pythonkeywords are case sensitive. There are 33 keywords in Python 3.7

Note** :  Python, keywords are case sensitive


Create Python script or Paste the below code on IDLE, that's all  😉


import keyword

print(keyword.kwlist)

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


Screenshot :



Get Help

Comments

Popular posts from this blog

How To Create .ENV File in Python

Create a Large file for Test Data Processing using Python

How to solve the Liner Equation using Python