Python id() FunctionPython id() function returns an identity of an object. This is an integer which is guaranteed to be unique. This function takes an argument an object and returns a unique integer number which represents identity. Two objects with non-overlapping lifetimes may have the same id() value. SignatureParametersobject : It is an object of which id is to be returned. ReturnIt returns a unique integer number. Let's see some examples of id() function to understand it's functionality. Python id() Function Example 1Output: 139963782059696 139963805666864 139963781994504 Python id() Function Example 2Output: 101 Mohan Object id: 140157155861392 Python id() Function Example 3Output: True False False False
Next TopicPython Set
|