W3docs

Determine the type of an object?

To determine the type of an object in Python, you can use the type function.

To determine the type of an object in Python, you can use the type function. For example:

Determine the type of an object in Python using the type function

python— editable, runs on the server
Info

Watch a video course: Python - The Practical Guide

You can also use the isinstance function to check if an object is an instance of a particular class or a subclass of that class. For example:

Determine the type of an object in Python using the isinstance function

python— editable, runs on the server