Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Is the following Python code valid?
>>> a=(1,2,3,4)
>>> del a

Is the following Python code valid?
>>> a=(1,2,3,4)
>>> del a
a) No because tuple is immutable
b) Yes, first element in the tuple is deleted
c) Yes, the entire tuple is deleted
d) No, invalid syntax for del method

Answer: c
Explanation: The command del a deletes the entire tuple.

Join The Discussion