Which of the following is the use of id() in python?
Answers
Answered by
8
The purpose of using the id() method is to return the ID/identity of a stored value.
For example:
>>> id(78)
1435413632
- This means that 1435413632 is the identity of the number '78'.
>>> id("Hello")
64295168
- 64295168 is the identity of the string 'Hello'.
The address is the unique identity of the object.
Similar questions
Math,
1 month ago
Environmental Sciences,
1 month ago
Math,
2 months ago
Math,
2 months ago
Math,
9 months ago