Skip to main content
Chapter 9 of 11
NCERT Solutions

Lists — NCERT Solutions

CBSE · Class 11 · Computer Science

NCERT question answers for Lists, CBSE Class 11 Computer Science: 20 textbook questions solved step by step. Covers Exercise and Programming Problems.

44 questions84 flashcards6 formulas & key relations5 concepts

Interactive on Super Tutor

Studying Lists? Get the full interactive chapter.

Quizzes, flashcards, AI doubt-solver and a step-by-step study plan — built for NCERT solutions and more.

Free trial, no card needed.

20 Questions Solved · 2 Sections

The first 10 solutions are open to read. The other 10 are free with a Super Tutor account. Unlock all 20 free in Super Tutor

Exercise

1(i)What will be the output of the following statements?

list1 = [12,32,65,26,80,10]
list1.sort()
print(list1)

Show solution

sort() arranges the list in ascending order and changes the original list.

So after list1.sort(), the list becomes:

[10, 12, 26, 32, 65, 80]

Not sure why a step works? check your working in Super Tutor

1(ii)What will be the output of the following statements?

list1 = [12,32,65,26,80,10]
sorted(list1)
print(list1)

Show solution

sorted(list1) creates a new sorted list but does not change list1.

Since the result is not stored anywhere, print(list1) prints the original list unchanged:

[12, 32, 65, 26, 80, 10]

Not sure why a step works? check your working in Super Tutor

1(iii)What will be the output of the following statements?

list1 = [1,2,3,4,5,6,7,8,9,10]
list1[::-2]
list1[:3] + list1[3:]

Show solution

list1[::-2] would give every second element in reverse order, but it is not printed or stored.

list1[:3] + list1[3:] joins the first three elements with the rest, so the list remains the same as the original:

[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

Not sure why a step works? check your working in Super Tutor

1(iv)What will be the output of the following statements?

list1 = [1,2,3,4,5]
list1[len(list1)-1]

Show solution

len(list1) is 55.
So len(list1) - 1 = 5 - 1 = 4.

list1[4] is the last element of the list, which is 5.

Not sure why a step works? check your working in Super Tutor

2Consider the following list myList. What will be the elements of myList after the following two operations:

myList = [10,20,30,40]
i. myList.append([50,60])
ii. myList.extend([80,90])

Show solution
  • append([50,60]) adds the entire list as one single element at the end.
  • extend([80,90]) adds each element separately at the end.

So the final list is:

[10, 20, 30, 40, [50, 60], 80, 90]

Not sure why a step works? check your working in Super Tutor

3What will be the output of the following code segment:

myList = [1,2,3,4,5,6,7,8,9,10]
for i in range(0,len(myList)):
if i%2 == 0:
print(myList[i])

Show solution

The loop runs with i = 0, 1, 2, ... 9.
It prints myList[i] only when i % 2 == 0, so it prints elements at even positions:

  • i = 0 → 1
  • i = 2 → 3
  • i = 4 → 5
  • i = 6 → 7
  • i = 8 → 9

Not sure why a step works? check your working in Super Tutor

4What will be the output of the following code segment:

a. myList = [1,2,3,4,5,6,7,8,9,10]
del myList[3:]
print(myList)
b. myList = [1,2,3,4,5,6,7,8,9,10]
del myList[:5]
print(myList)
c. myList = [1,2,3,4,5,6,7,8,9,10]
del myList[::2]
print(myList)

Show solution
  • a. del myList[3:] deletes elements from index 3 to the end, so the list becomes [1, 2, 3].
  • b. del myList[:5] deletes the first five elements, so the list becomes [6, 7, 8, 9, 10].
  • c. del myList[::2] deletes every second element starting from index 0, so the remaining list is [2, 4, 6, 8, 10].

Not sure why a step works? check your working in Super Tutor

5Differentiate between append() and extend() functions of list.Show solution
  • append() inserts its argument as one element at the end of the list.
  • Example: [10, 20].append([30, 40]) gives [10, 20, [30, 40]]
  • extend() adds the individual elements of the given list to the end.
  • Example: [10, 20].extend([30, 40]) gives [10, 20, 30, 40]

So, append() increases the list by one element, whereas extend() merges another list element by element.

Not sure why a step works? check your working in Super Tutor

6Consider a list:

list1 = [6,7,8,9]

What is the difference between the following operations on list1:

a. list1 * 2
b. list1 *= 2
c. list1 = list1 * 2

Show solution

For list1 = [6,7,8,9]:

  • **list1 * 2** produces [6, 7, 8, 9, 6, 7, 8, 9], but list1 itself is unchanged if the result is not assigned.
  • **list1 = 2* modifies the list in place, so list1 becomes [6, 7, 8, 9, 6, 7, 8, 9].
  • **list1 = list1 * 2** also results in [6, 7, 8, 9, 6, 7, 8, 9], but by assigning the new list back to list1.

Not sure why a step works? check your working in Super Tutor

7The record of a student (Name, Roll No., Marks in five subjects and percentage of marks) is stored in the following list:

stRecord = ['Raman', 'A-36', [56, 98, 99, 72, 69],
78.8]

Write Python statements to retrieve the following information from the list stRecord.

a) Percentage of the student
b) Marks in the fifth subject
c) Maximum marks of the student
d) Roll no. of the student
e) Change the name of the student from 'Raman' to 'Raghav'

Show solution

Using list indexing:

  • The percentage is the 4th element, so stRecord[3].
  • The marks in the fifth subject are inside the nested list at index 2, and the fifth subject is index 4, so stRecord[2][4].
  • The maximum marks from the marks list are found with max(stRecord[2]).
  • The roll number is the 2nd element, so stRecord[1].
  • To change the name, assign a new value to the first element: stRecord[0] = 'Raghav'.

Not sure why a step works? check your working in Super Tutor

Programming Problems

1Write a program to find the number of times an element occurs in the list.

Free with a Super Tutor account

2Write a program to read a list of n integers (positive

Free with a Super Tutor account

3Write a function that returns the largest element of the list passed as parameter.

Free with a Super Tutor account

4Write a function to return the second largest number from a list of numbers.

Free with a Super Tutor account

5Write a program to read a list of n integers and find their median.

Note: The median value of a list of values is the middle one when they are arranged in order. If there are two middle values then take their average.

Hint: You can use an built-in function to sort the list

Free with a Super Tutor account

6Write a program to read a list of elements. Modify this list so that it does not contain any duplicate elements, i.e., all elements occurring multiple times in the list should appear only once.

Free with a Super Tutor account

7Write a program to read a list of elements. Input an element from the user that has to be inserted in the list. Also input the position at which it is to be inserted. Write a user defined function to insert the element at the desired position in the list.

Free with a Super Tutor account

8(a)Write a program to read elements of a list.

The program should ask for the position of the element to be deleted from the list. Write a function to delete the element at the desired position in the list.

Free with a Super Tutor account

8(b)Write a program to read elements of a list.

The program should ask for the value of the element to be deleted from the list. Write a function to delete the element of this value from the list.

Free with a Super Tutor account

9Read a list of n elements. Pass this list to a function which reverses this list in-place without creating a new list.

Free with a Super Tutor account

10 more solved questions in Lists

They are free with a Super Tutor account, along with practice quizzes and flashcards for this chapter. Free to start, no card needed.

Frequently Asked Questions

What are the important topics in Lists for CBSE Class 11 Computer Science?
Key topics in Lists include Introduction to Lists, List Operations, Traversing a List, List Methods and Built-in Functions. Study these first, then practise questions on each for Class 11 exams.
Are these NCERT Solutions for Lists free?
The first 10 of the 20 solutions on this page are open to read. The other 10 are free with a Super Tutor account — signing up is free and needs no card.
How should I revise Lists for Class 11 exams?
Learn the core ideas first, then work through the 44 practice questions on Lists. Revise definitions regularly and use flashcards for quick recall before the exam.

Sources & Official References

Content is aligned to the official syllabus. Refer to the board website for the latest curriculum.

For serious students

Get the full Lists chapter — start free.

Quizzes, flashcards, an AI doubt solver and a study plan for CBSE Class 11 Computer Science. Free to start, no card needed.