python if instance nonetype code example Example: test if object is NoneType python if variable is None: