Python None keyword

Instance

Assign None to a variable:

x = None
print(x)

Run Dabbanci

Definition and Usage

None keyword is used to define null value, or no value at all.

None is different from 0, False or empty string. None is its own data type (NoneType), and only None can be None.

More Instances

Instance

If you do a boolean if test, what will happen? None is True or False:

x = None
if x:
  print("Do you think None is True")
else:
  print("None is not True...")

Run Dabbanci