Junior — Middle
Is it possible to assign the value None to a variable in Python?
sobes.tech AI
Answer from AI
Yes, in Python, a variable can be assigned the value None. This is a special value that indicates the absence of a value or emptiness. For example:
x = None
if x is None:
print("Variable x does not contain data")
None is often used for initializing variables or indicating the absence of a result.