Dictionary in Python Quiz #5

Share with others

Welcome to your Dictionary in Python Quiz #5

Q41. Which of the following is feature of Dictionary?

Q42. A = {"A" : "Apple", "B" : "Ball", "C" : "Cat"}

Which of the following statement will return :

dict_items([('A', 'Apple'), ('B', 'Ball'), ('C', 'Cat')])

Q43. Which of the following are immutable data type?

a. String
b. Tuple
c. List
d. Dictionary

Q44. _________ function returns the value corresponding to the key passed as the argument.

Q45. Write the output of the following :

A = {"A" : "Apple", "B" : "Ball", "C" : "Cat"}
print(A.get("D"))

Q46. Which function helps to merge dictionary 'D1' and 'D2'?

Q47. Which function/statement delete the dictionary from the memory?

Q48. Which function/statement delete all the items of the dictionary?

Q49. Choose the correct statement, in reference to the following code:

D1.update(D2) #D1 and D2 are dictionaries

Q50. Write a statement to retrieve the value corresponding to the key 7 in dictionary 'D1'.


Share with others

Leave a Reply

error: Content is protected !!