Home>Article>Backend Development> 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:
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!