COMPUTER SCIENCE AND ENGINEERING
DATA STRUCTURES
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
Which of the following is the use of id() function in python?
|
Id returns the identity of the object
|
|
Every object doesn’t have a unique id
|
|
All of the mentioned
|
|
none of above
|
Explanation:
Detailed explanation-1: -The id() function returns a unique id for the specified object. All objects in Python has its own unique id. The id is assigned to the object when it is created.
Detailed explanation-2: -Answer: The id( ) function is an in-built function which returns a unique id for the specified object. All objects in python has its own unique id. So, the correct answer is (a).
Detailed explanation-3: -The id() method returns a unique integer (identity) of a passed argument object.
There is 1 question to complete.