Skip to main content

Lists In Python — Part 2 MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on Lists In Python — Part 2 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.

Questions
40
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
48 mins
Exam-Level FPSC PPSC NTS NITB PTS
Verified for Commission Syllabus • Oct 14, 2026
40

Verified Practice Questions

Interactive test mode with detailed academic worked solutions

Live Progress | 0/40 answered
✓ 0 correct ✗ 0 wrong 0% score
Question 1 of 40
★ FPSC ★ PPSC

What will be the output of the following Python code? l1=[2,4,6] l2=[-2,-4,-6] for i in zip(l1, l2): print(i)

Question 2 of 40
★ FPSC ★ PPSC

What will be the output of the following Python code? def increment_items(L, increment): i = 0 while i < len(L): L[i] = L[i] + increment i = i + 1 values = [1, 2, 3] print(increment_items(values, 2)) print(values)

Question 3 of 40
★ FPSC ★ PPSC

What will be the output of the following Python code? A = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] B = [[3, 3, 3], [4, 4, 4], [5, 5, 5]] zip(A, B)

Question 4 of 40
★ FPSC ★ PPSC

What will be the output of the following Python code? a=["Apple","Ball","Cobra"] a.sort(key=len) print(a)

Question 5 of 40
★ FPSC ★ PPSC

What will be the output of the following Python code? veggies = ['carrot', 'broccoli', 'potato', 'asparagus'] veggies.insert(veggies.index('broccoli'), 'celery') print(veggies)

Question 6 of 40
★ FPSC ★ PPSC

What will be the output of the following Python code? >>>list1 = [11, 2, 23] >>>list2 = [11, 2, 2] >>>list1 < list2

Question 7 of 40
★ FPSC ★ PPSC

What will be the output of the following Python code? l=[[1 ,2, 3], [4, 5, 6], [7, 8, 9]] [[row[i] for row in l] for i in range(3)]

Question 8 of 40
★ FPSC ★ PPSC

What will be the output of the following Python code? A = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] [A[row][1] for row in (0, 1, 2)]

Question 9 of 40
★ FPSC ★ PPSC

What is the output of the following piece of code? a=list((45,)*4) print((45)*4) print(a)

Question 10 of 40
★ FPSC ★ PPSC

What will be the output of the following Python code? l=[[1, 2, 3], [4, 5, 6]] for i in range(len(l)): for j in range(len(l[i])): l[i][j]+=10 l

Question 11 of 40
★ FPSC ★ PPSC

To shuffle the list(say list1) what function do we use?

Question 12 of 40
★ FPSC ★ PPSC

What will be the output of the following Python code? t=32.00 [round((x-32)*5/9) for x in t]

Question 13 of 40
★ FPSC ★ PPSC

To which of the following the "in" operator can be used to check if an item is in it?

Question 14 of 40
★ FPSC ★ PPSC

Read the information given below carefully and write a list comprehension such that the output is: ['e', 'o'] w="hello" v=('a', 'e', 'i', 'o', 'u')

Question 15 of 40
★ FPSC ★ PPSC

What will be the output of the following Python code? import math [str(round(math.pi)) for i in range (1, 6)]

Question 16 of 40
★ FPSC ★ PPSC

What will be the output of the following Python code? l=[1,2,3,4,5] [x&1 for x in l]

Question 17 of 40
★ FPSC ★ PPSC

What will be the output of the following Python code? a = [1, 5, 7, 9, 9, 1] b=a[0] x= 0 for x in range(1, len(a)): if a[x] > b: b = a[x] b= x print(b)

Question 18 of 40
★ FPSC ★ PPSC

What will be the output of the following Python code? a="hello" b=list((x.upper(),len(x)) for x in a) print(b)

Question 19 of 40
★ FPSC ★ PPSC

What will be the output of the following Python code? values = [[3, 4, 5, 1], [33, 6, 1, 2]] v = values[0][0] for row in range(0, len(values)): for column in range(0, len(values[row])): if v < values[row][column]: v = values[row][column] print(v)

Question 20 of 40
★ FPSC ★ PPSC

What will be the output of the following Python code? >>> a=[14,52,7] >>>> b=a.copy() >>> b is a

Question 21 of 40
★ FPSC ★ PPSC

Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after list1.reverse()?

Question 22 of 40
★ FPSC ★ PPSC

What will be the output of the following Python code? names1 = ['Amir', 'Bear', 'Charlton', 'Daman'] names2 = names1 names3 = names1[:] names2[0] = 'Alice' names3[1] = 'Bob' sum = 0 for ls in (names1, names2, names3): if ls[0] == 'Alice': sum += 1 if ls[1] == 'Bob': sum += 10 print sum

Question 23 of 40
★ FPSC ★ PPSC

What is the list comprehension equivalent for: list(map(lambda x:x**-1, [1, 2, 3]))?

Question 24 of 40
★ FPSC ★ PPSC

What will be the output of the following Python code? [ord(ch) for ch in 'abc']

Question 25 of 40
★ FPSC ★ PPSC

What will be the output of the following Python code? A = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] B = [[3, 3, 3], [4, 4, 4], [5, 5, 5]] [B[row][col]*A[row][col] for row in range(3) for col in range(3)]

Question 26 of 40
★ FPSC ★ PPSC

Suppose listExample is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after listExample.pop(1)?

Question 27 of 40
★ FPSC ★ PPSC

What is the output when we execute list("hello")?

Question 28 of 40
★ FPSC ★ PPSC

What is the output of print(k) in the following Python code snippet? k = [print(i) for i in my_string if i not in "aeiou"] print(k)

Question 29 of 40
★ FPSC ★ PPSC

Write a list comprehension equivalent for the Python code shown below. for i in range(1, 101): if int(i*0.5)==i*0.5: print(i)

Question 30 of 40
★ FPSC ★ PPSC

Suppose list1 = [0.5 * x for x in range(0, 4)], list1 is:

Question 31 of 40
★ FPSC ★ PPSC

What will be the output of the following Python code? data = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]] def ttt(m): v = m[0][0] for row in m: for element in row: if v < element: v = element return v print(ttt(data[0]))

Question 32 of 40
★ FPSC ★ PPSC

What will be the output of the following Python code? word1="Apple" word2="Apple" list1=[1,2,3] list2=[1,2,3] print(word1 is word2) print(list1 is list2)

Question 33 of 40
★ FPSC ★ PPSC

Suppose list1 is [4, 2, 2, 4, 5, 2, 1, 0], Which of the following is correct syntax for slicing operation?

Question 34 of 40
★ FPSC ★ PPSC

What will be the output of the following Python code? names1 = ['Amir', 'Bala', 'Chales'] if 'amir' in names1: print(1) else: print(2)

Question 35 of 40
★ FPSC ★ PPSC

What will be the output of the following Python code? a=165 b=sum(list(map(int,str(a)))) print(b)

Question 36 of 40
★ FPSC ★ PPSC

What will be the output of the following Python code? a=[[]]*3 a[1].append(7) print(a)

Question 37 of 40
★ FPSC ★ PPSC

What will be the output of the following Python code? def unpack(a,b,c,d): print(a+d) x = [1,2,3,4] unpack(*x)

Question 38 of 40
★ FPSC ★ PPSC

What will be the output of the following Python code snippet? print([if i%2==0: i; else: i+1; for i in range(4)])

Question 39 of 40
★ FPSC ★ PPSC

Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], what is list1.count(5)?

Question 40 of 40
★ FPSC ★ PPSC

What will be the output of the following Python list comprehension? [j for i in range(2,8) for j in range(i*2, 50, i)]

✓ Link copied to clipboard
Continue Your Practice

Advance Html — Part 1

Master the next curriculum module with 40 exam-standard MCQs.

Next Practice Set →

💡 Examiner's Advisory for Programming & Software Development

In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.

More Modules in Programming & Software Development

View All →
📚

Study Guides

Topic summaries and syllabus breakdown

Explore Guides →
🎯

Complete Library

Search through 78,000+ verified MCQs

Browse Library →
📱

Mobile App

Offline mock tests and instant bookmarks

Get Mobile App →