ReferenceBuilt-in functions
type()
The class an object belongs to.
Signature
type(object)Parameters
| Name | Means |
|---|---|
object | anything |
Returns
A type object. .__name__ gives just the name.
Example
Python
print(type(5).__name__)
print(type("a").__name__)
print(type([]).__name__)
print(type(None).__name__)Output
int str list NoneType