What is the use of the type () function in Python
This article shows you the use of the type () function in Python, which is concise and easy to understand. It will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
Example
Returns the type of these objects:
A = ('apple',' banana', 'cherry') b = "Hello World" c = 55x = type (a) y = type (b) z = type (c)
Run an example
Definition and usage
The type () function returns the type of the specified object.
Syntax type (object, bases, dict) parameter value parameter description object is required. If only one parameter is set, the type () function returns the type of this object. Bases is optional. Stipulate the base class. Dict is optional. Specifies a namespace with a class definition. What is the use of the type () function in Python? have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.