Home  >  Article  >  Backend Development  >  What is the python empty type?

What is the python empty type?

(*-*)浩
(*-*)浩Original
2019-07-02 14:26:558335browse

Empty type

None is a special value. It cannot be said to be 0, nor is it a string. None means nothing, it is empty. object.

What is the python empty type?

None is a special constant. (Recommended learning: Python video tutorial)

None is different from False.

None is not 0.

None is not an empty string.

None will always return False when compared with any other data type.

None has its own data type NoneType.

You can copy None to any variable, but you cannot create other NoneType objects.

Nonetype and null value are inconsistent. It can be understood that Nonetype means that this parameter does not exist. Null value means that the parameter exists, but the value is empty.

The judgment method is as follows:

if hostip is None:  
       print "no hostip,is nonetype"  
elif hostip:  
       print "hostip is not null"    
 else:  
       print " hostip is null"

For more Python-related technical articles, please visit the Python Tutorial column to learn!

The above is the detailed content of What is the python empty type?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn