Skip to main content
Chapter 9 of 11
NCERT Solutions

Lists

CBSE · Class 11 · Computer Science

NCERT Solutions for Lists — CBSE Class 11 Computer Science.

44 questions84 flashcards5 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.

1,000+ Class 11 students started this chapter today

20 Questions Solved · 2 Sections

10 worked solutions below. Unlock all 20 free in Super Tutor

EXERCISE

1(i)What will be the output of the following statements?Show solution
`sort()` changes the list in place and arranges the elements in ascending order.

So `list1` becomes:

`[12, 32, 65, 26, 80, 10] -> [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?Show solution
`sorted(list1)` creates a new sorted list and does not change the original list when the result is not stored anywhere.

So `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?Show solution
- `list1[::-2]` produces a slice, but since it is not printed or stored, it has no visible output.
- `list1[:3] + list1[3:]` joins the first three elements with the remaining elements, so the list is unchanged.

Therefore the resulting list is:

`[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?Show solution
`list1[len(list1)-1]` means the last element.

- `len([1,2,3,4,5]) = 5`
- so the index is `5 - 1 = 4`
- `list1[4] = 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:Show solution
- append([50,60]) adds the whole list as a single element at the end.
- extend([80,90]) adds each element separately to the end.

So:

1. After `myList.append([50,60])` → `[10, 20, 30, 40, [50, 60]]`
2. After `myList.extend([80,90])` → `[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:Show solution
The loop checks every index `i` from `0` to `9`.

It prints `myList[i]` only when `i % 2 == 0`, i.e. for even indices:

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

So the output is:

`1`
`3`
`5`
`7`
`9`

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

4What will be the output of the following code segment:Show solution
- a. `del myList[3:]` deletes from index `3` to the end, so only the first three elements remain.
- Result: `[1, 2, 3]`
- b. `del myList[:5]` deletes from the start up to index `4`, so the last five elements remain.
- Result: `[6, 7, 8, 9, 10]`
- c. `del myList[::2]` deletes every element at even indices: `1, 3, 5, 7, 9`.
- Remaining elements are at odd indices: `[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:Show solution
For `list1 = [6,7,8,9]`:

- **a. `list1 * 2` → returns `[6, 7, 8, 9, 6, 7, 8, 9]`, but `list1` remains unchanged if the result is not stored.
-
b. `list1 *= 2` → updates the same list in place, so `list1` becomes `[6, 7, 8, 9, 6, 7, 8, 9]`.
-
c. `list1 = list1 * 2` → creates a new repeated list and assigns it to `list1`; the final contents are also `[6, 7, 8, 9, 6, 7, 8, 9]`.

The difference is that
`* 2` only produces a value, while `*= 2` modifies the list in place and `list1 = list1 * 2` reassigns `list1` to a new list**.

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.
Show solution
The list structure is:

- `stRecord[0]` → name
- `stRecord[1]` → roll no.
- `stRecord[2]` → list of marks
- `stRecord[3]` → percentage

So:

- a) Percentage of the student: `stRecord[3]`
- b) Marks in the fifth subject: `stRecord[2][4]`
- c) Maximum marks of the student: `max(stRecord[2])`
- d) Roll no. of the student: `stRecord[1]`
- e) Change the name: `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.
2Write a program to read a list of n integers (positive
3Write a function that returns the largest element of the list passed as parameter.
4Write a function to return the second largest number from a list of numbers.
5Write a program to read a list of n integers and find their median.
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.
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.
8(a)Write a program to read elements of a list.
8(b)Write a program to read elements of a list.
9Read a list of n elements. Pass this list to a function which reverses this list in-place without creating a new list.

10 more solved questions in Lists

Every remaining exercise is solved step by step in Super Tutor, plus practice quizzes and flashcards for this chapter. Free to start.

Stuck on a step?

Ask Super Tutor AI to explain any solution on this page in a simpler way — free, 24x7.

Ask a Doubt Free

Frequently Asked Questions

What are the important topics in Lists for CBSE Class 11 Computer Science?
Lists covers several key topics that are frequently asked in CBSE Class 11 board exams. Focus on the core concepts listed on this page and practise related questions to build confidence.
How to score full marks in Lists — CBSE Class 11 Computer Science?
Understand the core concepts first, then work through the 44 practice questions available for this chapter. Revise formulas and definitions regularly, and use flashcards for quick recall before the exam.
Where can I get free NCERT Solutions for Lists Class 11 Computer Science?
This page has free step-by-step NCERT Solutions for every exercise question in Lists (CBSE Class 11 Computer Science) — written the way examiners award marks: given, formula, working, answer.

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 — for free.

Quizzes, flashcards, AI doubt-solver and a step-by-step study plan for CBSE Class 11 Computer Science.