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 Python, keywords 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']
Comments
Post a Comment