Chapter-4 (2) MCQ
Chapter-4 (2) MCQ
4. Which of the following functions will return the key, value pairs of a
dictionary?
(a) keys()
(b) values()
(c) items()
(d) all of these
6. Which of the following will raise an error if the given key is not found in the
dictionary ?
(a) del statement
(b) pop()
(c) getitem()
(d) all of these
14. Which of the following will delete key_value pair for key = "tiger" in
dictionary?
di = {"loin" : "wild", "tiger" : "wild", "cat": "domestic" : "dog" : "domestic"}
(a) del di["tiger"]
(b) di[“tiger”].delete()
(c) delete(di.["tiger"])
(d) del(di.["tiger])
Ans
1. False
2. True
3. True
4. False
5. False
6. False
7. True
8. True
9. False
10. False
11. True