What will happen when the following Python statement is executed?

ptr = None
del ptr
print("Success")
                        

Options

  • A. It gives a SyntaxError
  • B. It gives a TypeError
  • C. It raises a NameError
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

E. None of the above

Detailed Explanation

The del statement removes the variable binding. Since the program only prints a string literal afterward, it executes successfully and displays Success.