Built-in Functions
type()
Find out what type of value an object is.
type(object)
type() tells you the class or built-in type of a value.
This is useful when you are checking what kind of data your code is handling.
Parameters
| Name | Description |
|---|---|
| object | The value whose type you want to inspect. |
Returns
The object's type.
Try it
Run it and change it
value = [1, 2] print(type(value).__name__)