CBSE Class 11 Computer Science Chapter 13: Lists, Dictionaries, and Tuples NCERT Solutions

NCERT Solutions PDF Class 11 PDF

This chapter provides NCERT Solutions for Class 11 Computer Science, focusing on Python's fundamental data structures: Lists, Dictionaries, and Tuples. The solutions cover various aspects of lists, including their types, indexing, slicing, and common methods like `remove()`, `append()`, `extend()`, `count()`, `len()`, `max()`, and `min()`. It also explains how to compare lists and convert sequences. These detailed explanations and step-by-step solutions are designed to help students understand the core concepts of these data structures, enabling them to solve problems effectively and prepare thoroughly for their examinations. The chapter emphasizes practical application and understanding of Python's list manipulation capabilities.

Quick info

BoardCBSE
ClassClass 11
SubjectComputer Science
Session2026
LanguageEnglish
TypeNCERT Solutions
Chapter13. Lists, Dictionaries and Tuples

Chapter summary

Chapter 13 on Lists, Dictionaries, and Tuples for CBSE Class 11 Computer Science offers NCERT Solutions that delve into Python's sequence data types. It covers the basics of lists, including built-in sequence types, element access via indexing and slicing, and essential methods for manipulation and information retrieval. The solutions explain how to remove elements, compare lists, find lengths, and identify maximum and minimum values. Methods for adding elements and counting occurrences are also detailed. This chapter is crucial for building a strong foundation in data structures for programming.

Learning outcomes

  • Identify the different types of built-in sequence types in Python.
  • Understand and apply list indexing to access individual elements.
  • Utilize list slicing to extract sub-sequences from a list.
  • Explain the functionality of various list methods like `remove()`, `append()`, `extend()`, and `count()`.
  • Determine the length of a list using the `len()` function.
  • Use `max()` and `min()` functions to find the largest and smallest elements in a list.
  • Compare elements of two lists using comparison functions.
  • Convert sequences like tuples into lists using the `list()` constructor.

Topics covered

Paper topics

  • Built-in sequence types in Python
  • List indexing
  • List slicing
  • Removing list elements (`del`, `remove()`)
  • List comparison (`cmp()` concept)
  • List length (`len()`)
  • Finding maximum and minimum elements (`max()`, `min()`)
  • Converting sequences to lists (`list()`)
  • Appending objects (`append()`)
  • Counting element occurrences (`count()`)
  • Extending lists (`extend()`)
  • Python List Operations

Important topics

  • List indexing and slicing
  • List manipulation methods (`append`, `extend`, `remove`, `count`)
  • Built-in functions for lists (`len`, `max`, `min`)
  • Understanding sequence types
  • Converting between sequence types

PDF preview

Read page by page below. PDF is streamed from the official NCERT website — no download button on this page.

Loading document …
Page of
Loading page …

Questions and Solutions

Question 1

How many types of built-in types of sequences are there in Python?
Solution:

Python offers six distinct built-in types of sequences. These are fundamental data structures used for storing ordered collections of items.

Question 2

Write the output of the given Python code.

#!/usr/bin/python list1 = ['physics', 'chemistry', 1997, 2000] list2 = [1, 2, 3, 4, 5, 6, 7] print "list1[0]", list1[0]

Solution:

The code initializes two lists, list1 and list2. It then prints the element at index 0 of list1. Since list indices start at 0, list1[0] refers to the first element.

Output:

list1[0]: physics

Question 3

Write the output of the given Python code.

#!/usr/bin/python list1 = ['physics', 'chemistry', 1997, 2000] list2 = [1, 2, 3, 4, 5, 6, 7] print "list2[1:5]", list2[1:5]

Solution:

This Python code initializes two lists. It then prints a slice of list2, specifically elements from index 1 up to (but not including) index 5. List slicing extracts a portion of the list.

Output:

list2[1:5]: [2, 3, 4, 5]

Question 4

How can we remove a list element?
Solution:

To remove an element from a list in Python, you have a couple of primary options:

  1. Using the del statement: You can remove an element at a specific index using del list_name[index].
  2. Using the remove() method: This method removes the first occurrence of a specified value from the list. The syntax is list_name.remove(value).

Question 5

Why do we use cmp(list1, list2) in Python?
Solution:

The cmp(list1, list2) function (primarily used in Python 2) was used to compare the elements of two lists lexicographically. It returned -1 if list1 < list2, 0 if list1 == list2, and 1 if list1 > list2. In Python 3, direct comparison operators like <, ==, and > are used for list comparison.

Question 6

What is the use of len(list) in Python?
Solution:

The built-in function len(list) is used to determine and return the total number of items or elements present in the list. It provides the size of the list.

Question 7

Describe the max(list) method.
Solution:

The built-in function max(list) returns the item from the list that has the highest value. This function works for lists containing comparable elements, such as numbers or strings.

Question 8

Describe the min(list) method.
Solution:

The built-in function min(list) returns the item from the list that has the lowest value. Similar to max(), this function requires the list elements to be comparable.

Question 9

What is the use of list(seq) in Python?
Solution:

The list(seq) constructor is used to convert a sequence (such as a tuple, string, or another iterable) into a list. For example, if seq is a tuple, list(seq) will create a new list containing the same elements in the same order.

Question 10

What do you mean by list.append(obj)?
Solution:

The list.append(obj) method is used to add a single item, referred to as obj, to the very end of the list. It modifies the original list in place.

Question 11

What do you mean by list.count(obj)?
Solution:

The list.count(obj) method returns the number of times a specified object or value, obj, appears within the list. It counts all occurrences of that value.

Question 12

Explain list.extend(seq).
Solution:

The list.extend(seq) method is used to append all the items from an iterable sequence (like another list, tuple, or string) to the end of the current list. It effectively adds the contents of seq to the existing list.

Common mistakes

  • Incorrectly specifying slice indices, leading to unexpected sub-sequences.
  • Confusing the `remove()` method with `pop()` or other deletion methods.
  • Misunderstanding the difference between `append()` and `extend()` when adding elements.
  • Off-by-one errors when accessing elements by index.
  • Assuming `cmp()` function is directly available in Python 3 without using appropriate comparison logic.

Revision tips

  • Practice accessing elements using both positive and negative indices.
  • Experiment with different slicing parameters to understand their effects.
  • Write small Python programs to test each list method described.
  • Compare the output of `append()` versus `extend()` with examples.
  • Review the purpose of each built-in sequence type and when to use them.

Practice MCQs

Q1. How many built-in types of sequences are available in Python?

Q2. What will be the output of `list1[0]` if `list1 = ['physics', 'chemistry', 1997, 2000]`?

Q3. What does the `list.remove(obj)` method do?

Q4. Which function returns the total number of items in a list?

Q5. What is the primary use of `list.extend(seq)`?

Frequently asked questions

What are the main sequence types in Python covered in this chapter?

This chapter focuses on Lists as a primary sequence type, discussing their properties and operations. While the chapter title mentions Dictionaries and Tuples, the provided solutions specifically detail various aspects of Python Lists.

How do I access elements in a Python list?

You can access elements using their index, which starts from 0 for the first element. For example, `my_list[0]` gets the first element. Negative indices can also be used, where `my_list[-1]` refers to the last element.

What is the difference between `append()` and `extend()` methods for lists?

The `append(obj)` method adds a single object `obj` as one element to the end of the list. The `extend(seq)` method, on the other hand, iterates over its argument `seq` and appends each of its elements to the list.

How can I remove an element from a list?

You can remove an element using the `del` statement with an index, or by using the `remove(obj)` method, which removes the first occurrence of the specified value `obj`.

What is the purpose of `len(list)`?

The `len(list)` function returns the total number of items or elements currently present in the list.

Can these solutions help me prepare for exams?

Yes, these NCERT Solutions provide clear explanations and cover essential concepts and methods related to Python lists, which are frequently tested in computer science exams.

Content reviewed by the NCERT Help team. Editorial Team and update policy

NCERT Solutions PDF PDF on NCERT Help. URL unchanged for search indexing.