⏪Previous Next⏩
Python Keywords
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 35 keywords in Python 3.7. This number can vary slightly over the course of time.
All the keywords except
True
, False
and None
are in lowercase and they must be written as they are.
1. True : This keyword is used to represent a boolean true. If a statement is true, “True” is printed.
2. False : This keyword is used to represent a boolean false. If a statement is false, “False” is printed.
True and False in python are same as 1 and 0.
True and False in python are same as 1 and 0.
3. None : This is a special constant used to denote a null value or a void. Its important to remember, 0, any empty container(e.g empty list) do not compute to None.
It is an object of its own datatype – NoneType. It is not possible to create multiple None objects and can assign it to variables.
It is an object of its own datatype – NoneType. It is not possible to create multiple None objects and can assign it to variables.
The list of all the keywords is given below.
1 Comments
Thanks
ReplyDelete