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.
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.
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
list1 = [12,32,65,26,80,10]
list1.sort()
print(list1)
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
list1 = [12,32,65,26,80,10]
sorted(list1)
print(list1)
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 = [1,2,3,4,5,6,7,8,9,10]
list1[::-2]
list1[:3] + list1[3:]
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
list1 = [1,2,3,4,5]
list1[len(list1)-1]
len(list1) is .
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
myList = [10,20,30,40]
i. myList.append([50,60])
ii. myList.extend([80,90])
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
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])
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→1i = 2→3i = 4→5i = 6→7i = 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. 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)
- 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
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
For list1 = [6,7,8,9]:
- **
list1 * 2** produces[6, 7, 8, 9, 6, 7, 8, 9], butlist1itself is unchanged if the result is not assigned. - **
list1 = 2* modifies the list in place, solist1becomes[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 tolist1.
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
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'
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
Free with a Super Tutor account
Free with a Super Tutor account
Free with a Super Tutor account
Free with a Super Tutor account
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
Free with a Super Tutor account
Free with a Super Tutor account
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
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
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?
Are these NCERT Solutions for Lists free?
How should I revise Lists for Class 11 exams?
Sources & Official References
- NCERT Official — ncert.nic.in
- CBSE Academic — cbseacademic.nic.in
- CBSE Official — cbse.gov.in
- National Education Policy 2020 — education.gov.in
Content is aligned to the official syllabus. Refer to the board website for the latest curriculum.
More resources for Lists
Practice Quiz
Test yourself with a quick quiz
Important Questions
Exam-style questions with answers
Revision Notes
Key points for last-minute revision
Formula Sheet
The chapter's formulas in one place
Chapter Summary
Understand the chapter at a glance
Concept Maps
See how topics connect
Study Plan
Step-by-step plan for this chapter
Flashcards
Quick-fire cards for active recall
Syllabus
What topics to cover
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.