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 9 of 13

Q81.
If a function doesn’t have a return statement, which of the following does the function return?
Discuss
Answer: (c).None
Q82.
What is the output of the following code?
def display(b, n):
    while n > 0:
        print(b,end="")
        n=n-1
display('z',3)
Discuss
Answer: (a).zzz
Q83.
What is the output of the following piece of code?
def find(a, **b):
   print(type(b))
find('letters',A='1',B='2')
Discuss
Answer: (c).Dictionary
Q84.
What is the output of the following code?
count={}
count[(1,2,4)] = 5
count[(4,2,1)] = 7
count[(1,2)] = 6
count[(4,2,1)] = 2
tot = 0
for i in count:
    tot=tot+count[i]
print(len(count)+tot)
Discuss
Answer: (c).16
Q85.
What is the output of the following code?
a={}
a[2]=1
a[1]=[2,3,4]
print(a[1][1])
Discuss
Answer: (b).3
Q86.
What is the output of the following piece of code?
>>> a={'B':5,'A':9,'C':7}
>>> sorted(a)
Discuss
Answer: (a).[‘A’,’B’,’C’].
Discuss
Answer: (d).{0: 0, 1: 1, 2: 4, 3: 9, 4: 16, 5: 25}
Q88.
What is the output of the following piece of code?
>>> a={}
>>> a.fromkeys([1,2,3],"check")
Discuss
Answer: (b).{1:”check”,2:”check”,3:”check”}
Q89.
What is the output of the following snippet of code?
>>> b={}
>>> all(b)
Discuss
Answer: (b).False
Discuss
Answer: (a).Returns True if any key of the dictionary is true

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!