var = None
Note: The “None” is not the same as zero, False, or an empty string. It is an object of the class NoneType.
Example None keyword in Python
Simple example code. Some time in development assigning a value of None to a variable is one way to reset it to its original, empty state.
var = None print(var) print(type(var))
If there are two variables assign the None value then variables point to the same object. The address of both the variables is the same.
var1 = None var2 = None print(id(var1)) print(id(var2))
Do comment if you have any doubts and suggestions on this Python None tutorial.
Note: IDE: PyCharm 2021.1.3 (Community Edition)
All Python Examples are in Python 3, so Maybe its different from python 2 or upgraded versions.
Degree in Computer Science and Engineer: App Developer and has multiple Programming languages experience. Enthusiasm for technology & like learning technical.