adplus-dvertising

Welcome to the Dictionary and Built in Functions MCQs Page

Dive deep into the fascinating world of Dictionary and Built in Functions with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Dictionary and Built in Functions, a crucial aspect of Python. In this section, you will encounter a diverse range of MCQs that cover various aspects of Dictionary and Built in Functions, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within Python.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Dictionary and Built in Functions. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of Python.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Dictionary and Built in Functions. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Dictionary and Built in Functions MCQs | Page 1 of 13

Discuss
Answer: (d).All of the mentioned
Q2.
Read the code shown below carefully and pick out the keys?
d = {"john":40, "peter":45}
Discuss
Answer: (b).“john” and “peter”
Q3.
What will be the output?
d = {"john":40, "peter":45}"
john" in d
Discuss
Answer: (a).True
Q4.
What will be the output?
d1 = {"john":40, "peter":45}
d2 = {"john":466, "peter":45}
d1 == d2
Discuss
Answer: (b).False
Q5.
What will be the output?
d1 = {"john":40, "peter":45}
d2 = {"john":466, "peter":45}
d1 > d2
Discuss
Answer: (d).Error
Q6.
What is the output?
d = {"john":40, "peter":45}
d["john"]
Discuss
Answer: (a).40
Q7.
Suppose d = {“john”:40, “peter”:45}, to delete the entry for “john” what command do we use
Discuss
Answer: (c).del d[“john”].
Q8.
Suppose d = {“john”:40, “peter”:45}. To obtain the number of entries in dictionary which command do we use?
Discuss
Answer: (b).len(d)
Q9.
What will be the output?
d = {"john":40, "peter":45}
print(list(d.keys()))
Discuss
Answer: (a).[“john”, “peter”].
Discuss
Answer: (c).Since “susan” is not a key in the set, Python raises a KeyError exception
Page 1 of 13

Suggested Topics

Are you eager to expand your knowledge beyond Python? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!