1. Home
  2. Data Science
  3. Python
  4. What does del x do in Python?

Added 25 Nov 2026

What does del x do in Python?

  1. Always frees the object immediately
  2. Removes the name x from the namespace Correct answer
  3. Deletes the file x
  4. Sets x to None

Correct answer

B. Removes the name x from the namespace

6 views

MCQSEXAM

Explanation

del removes the binding; the object is freed when no references remain.

Reference

Asked in: Python Interview Advanced

https://docs.python.org/3/library/index.html

Preparing for an exam?

Doubts & discussion

Not sure why the answer is B? 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