I am new to coding. I saw some code where variable = None, what does it mean? I can't find an answer anywhere online.
Thanks in advance!
I am new to coding. I saw some code where variable = None, what does it mean? I can't find an answer anywhere online.
Thanks in advance!
It sets a variable named variable
to None
(Python's version of a null/nonetype object).
See a demonstration below:
>>> variable = None
>>> type(variable)
<type 'NoneType'>
>>>
I really think you should read one of the many Python tutorials out there since this is a fundamental language concept. Here are some I found useful:
It assigns the value None
to the variable variable
. I recommend you read the tutorial; it will answer this question and many more.