Home > Backend Development > Python Tutorial > How to check data type in python

How to check data type in python

Release: 2019-07-03 17:49:34
Original
15268 people have browsed it

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

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 the Python Tutorial column 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!

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