using python 2.:
"Which of the following statements is ``WRONG`` about Object?
<br>\n",
"(A) An object has an id, which can be obtained by using the
function ``id`` <br>\n",
"(B) An object has a type, which can be obtained by using the
function ``type``<br>\n",
"(C) int numbers (type: int, e.g., 10) in Python are not objects
<br>\n",
"(D) The id of an object is unique during the lifetime of the
object"
Answer: C - "(C) int numbers (type: int, e.g., 10) in Python are not objects <br>\n"
Explanation:
Every object has an identity, a type and a value. An object's identity never changes once it has been created;
The id() function returns an integer representing its identity (currently implemented as its address).
The type() function returns an object's type (which is an object itself).
The only wrong statement int numbers (type: int, e.g., 10) in Python are not objects because int is a class
Get Answers For Free
Most questions answered within 1 hours.