The type () function is a simple and practical method for querying object data types in python. This article mainly introduces the usage and usage of the type () function.
What can the type () function do?
As mentioned in the article about data types, how to view the data types of objects is required. Type () is the most practical and simple way to view data types. Type () is a built-in function. You can call it to obtain an inverse value to know the object type information you want to query.
How to use the type () function
Use type (): type (object)
Type () is to receive an object as a reference, and then return the corresponding type of the object.
>>> Type (1)
<Type 'int'> # integer
>>> Type ('iplaypython ')
<Type 'str'> # string
Type () what type is returned?
>>> Type (1 ))
<Type 'type'> # type
Originally, these return values are of the type.