Skip to content
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

NameDescription
objectThe 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__)

Related entries