Python does not have a "null" value. However, you can use the "
None" keyword instead to represent null values, which implies absence of value.
None can be used with variables, function/method arguments or return value, etc.
For example, assigning
None to a variable implies it has no value (or "null" value):
foo = None print(foo) # None
def foo(param = None): if param is None: return 'empty' print(foo()) # 'empty'
def foo(): return None print(foo()) # None
Hope you found this post useful. It was published . Please show your love and support by sharing this post.