id () is a built-in function in Python.
As we can see, the function takes one parameter and is used to return the object ID. This identity must be unique and persistent for this object throughout its life. Two objects with non-overlapping lifetimes can have the same id () value. If we associate this with C, then it is actually a memory address, here in Python it is a unique identifier. This function is commonly used internally in Python.
The output is the identity of the object passed. This is random but when running in the same program, it generates unique and same identity. Input: id (1025) Output: 140365829447504 Output varies with different runs Input: id ("geek") Output: 139793848214784
140252505691448 140252505691448 True 140252505691840 140252505739928 False