adplus-dvertising
frame-decoration

Question

What is the output of the following snippet of code?
>>> a={1:"A",2:"B",3:"C"}
>>> del a

a.

method del doesn’t exist for the dictionary

b.

del deletes the values in the dictionary

c.

del deletes the entire dictionary

d.

del deletes the keys in the dictionary

Posted under Python

Answer: (c).del deletes the entire dictionary

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of the following snippet of code?

Similar Questions

Discover Related MCQs

Q. If a is a dictionary with some key-value pairs, what does a.popitem() do?

Q. Which of the following functions is a built-in function in python?

Q. The function pow(x,y,z) is evaluated as:

Q. What is the output of the function complex() ?

Q. The function divmod(a,b), where both ‘a’ and ‘b’ are integers is evaluated as:

Q. Which of the following functions accepts only integers as arguments?

Q. Suppose there is a list such that: l=[2,3,4].
If we want to print this list in reverse order, which of the following methods should be used?

Q. Which of the following is the use of function in python?

Q. Which keyword is use for function?

Q. Which are the advantages of functions in python?

Q. What are the two main types of functions?

Q. Where is function defined?

Q. What is called when a function is defined inside a class?

Q. Which of the following is the use of id() function in python?

Q. Which of the following refers to mathematical function?

Q. Python supports the creation of anonymous functions at runtime, using a construct called __________

Q. Does Lambda contains return statements?

Q. What is a variable defined outside a function referred to as?

Q. What is a variable defined inside a function referred to as?

Q. If a function doesn’t have a return statement, which of the following does the function return?