Home > Backend Development > Python Tutorial > What is the python empty type?

What is the python empty type?

(*-*)浩
Release: 2019-07-09 10:35:09
Original
8342 people have browsed it

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"
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template