type()

Built-in FunctionPython 2.0+Beginner

Returns the type of an object, or creates a new type dynamically

Quick Info

Documentation
Official Docs
Python Version
2.0+

Learn by Difficulty

Quick Example

python
print(type(42))
print(type("hello"))
print(type([1, 2, 3]))
print(type(True))

type() is a built-in function that returns the type of an object, or creates a new type dynamically.

Try in Playground

Tags

builtinfunctioncoreoopintrospectionmetaclassdatatype

Related Items