What does del x do in Python?
-
A
Always frees the object immediately
-
B
Removes the name x from the namespace
Correct answer
-
C
Deletes the file x
-
D
Sets x to None
Correct answer
B. Removes the name x from the namespace
6 views
Explanation
del removes the binding; the object is freed when no references remain.
Doubts & discussion
Not sure why the answer is B? Ask here and get an explanation.
Ask a doubt about this MCQ