adplus-dvertising

Welcome to the Lists in Python MCQs Page

Dive deep into the fascinating world of Lists in Python with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Lists in Python, a crucial aspect of Python. In this section, you will encounter a diverse range of MCQs that cover various aspects of Lists in Python, 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 Lists in Python. 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 Lists in Python. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Lists in Python MCQs | Page 12 of 12

Q111.
What is the output of the following code?
def unpack(a,b,c,d):
    print(a+d)
x = [1,2,3,4]
unpack(*x)
Discuss
Answer: (d).5
Q112.
What is the output of the following code?
places = ['Bangalore', 'Mumbai', 'Delhi']
<br class="blank" />places1 = places
places2 = places[:]
<br class="blank" />places1[1]="Pune"
places2[2]="Hyderabad"
print(places)
Discuss
Answer: (b).[‘Bangalore’, ‘Pune’, ‘Delhi’].
Q113.
What is the output of the following piece of code?
x=[[1],[2]]
print(" ".join(list(map(str,x))))
Discuss
Answer: (a).[1] [2].
Q114.
What is the output of the following code?
a=165
b=sum(list(map(int,str(a))))
print(b)
Discuss
Answer: (c).12
Q115.
What is the output of the following code?
a= [1, 2, 3, 4, 5]
for i in range(1, 5):
    a[i-1] = a[i]
for i in range(0, 5): 
    print(a[i],end = " ")
Discuss
Answer: (d).2 3 4 5 5
Q116.
What is the output of the following code?
def change(var, lst):
    var = 1
    lst[0] = 44
k = 3
a = [1, 2, 3]
change(k, a)
print(k)
print(a)
Discuss
Answer: (a).3
[44, 2, 3].
Page 12 of 12

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!