1. Home
  2. Data Science
  3. Python
  4. What does the id() function return in Python?

Added 25 Nov 2026

What does the id() function return in Python?

  1. The unique identity (memory address in CPython) of an object Correct answer
  2. The data type of an object
  3. The length of an object
  4. The hash of an object

Correct answer

A. The unique identity (memory address in CPython) of an object

MCQSEXAM

Explanation

id() returns an integer unique to the object during its lifetime; in CPython it is the memory address.

Reference

Asked in: Python Interview Basics

https://docs.python.org/3/tutorial/introduction.html

Preparing for an exam?

Doubts & discussion

Not sure why the answer is A? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs