object() Bulit-in Function

Python – object()

Python object() built-in function is used to create an empty object.

In this tutorial, we will learn the syntax and usage of object() built-in function with examples.

Syntax

The syntax of object() function is

object()

The function does not accept any parameters.

Examples

1. Create empty object

In the following program, we will create an empty object using object() function.

Python Program

myObj = object()
print(myObj)
Run Code Copy

Output

<object object at 0x1046bc1c0>

About Object

object is the base for all classes. This object has properties and methods that are common to all objects of other types (builtin classes, or user defined classes).

Summary

In this Built-in Functions tutorial, we learned the syntax of the object() built-in function, and how to use this function to create an empty object.

Related Tutorials

Code copied to clipboard successfully 👍