Which of the following is the use of id() function in python?

Questions & AnswersCategory: Programming LanguageWhich of the following is the use of id() function in python?
Geek Boy Staff asked 2 years ago

Which of the following is the use of id() function in python?
a. Every object in Python doesn’t have a unique id
b. In Python Id function returns the identity of the object
c. None of the mentioned
d. All of the mentioned

1 Answers
Geek Boy Staff answered 2 years ago

b. In Python Id function returns the identity of the object
Explanation: Each object in Python has a unique id. The id() function returns the object’s id.