Home>Article>Backend Development> How to check data type in python

How to check data type in python

尚
Original
2019-07-03 17:49:34 15135browse

How to check data type in python

Python can use the built-in function type() to view the data type

type() function introduction:

type() The function returns the type of the object if you have only one parameter, and returns the new type object with three parameters.

Type() method syntax:

type(object)type(name, bases, dict)

Parameters:

name -- the name of the class. bases – A tuple of base classes. dict – Dictionary, namespace variables defined within the class.

Return value:

One parameter returns the object type, three parameters returns the new type object.

Use the type() function to view the data type:

How to check data type in python

For more Python related technical articles, please visit thePython Tutorialcolumn to learn !

The above is the detailed content of How to check data type in python. 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
Previous article:How to uninstall python3.5 Next article:How to uninstall python3.5