Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Python id() Function

Python id() Function

Python built-in function Python built-in function


Description

id() The function returns the unique identifier of an object, which is an integer.

In CPython id() The function is used to obtain the memory address of an object.

Syntax

id syntax:


id([object])

Parameter Description:

Return Value

Returns the memory address of the object.

Example

The following examples demonstrate how to use id:

a

=

'

runoob

'

id

(

a

)

4531887632

b

=

1

id

(

b

)

140588731085608

Python built-in function Python built-in function