NCERT Class 11 Computer Science Computer Science: Chapter 8 — Strings

NCERT CBSE Class 11 Computer Science Computer Science Chapter 8 English PDF

This chapter introduces strings as a fundamental data type in Python, building upon the concept of sequences. It explains that strings are ordered collections of one or more Unicode characters, which can include letters, digits, whitespace, or symbols. Strings can be created using single, double, or triple quotes, with triple quotes allowing for multi-line strings. The chapter details how to access individual characters within a string using indexing, both positive (from left to right, starting at 0) and negative (from right to left, starting at -1). It also highlights that Python does not have a separate character data type and that attempting to access an index outside the string's bounds results in an IndexError, while non-integer indices cause a TypeError. This foundational understanding of strings is crucial for further programming concepts in Python.

Quick info

BoardCBSE / NCERT
ClassClass 11
SubjectComputer Science
BookComputer Science
ChapterChapter 8 — Strings
LanguageEnglish
PDF typeNCERT Textbook
SessionCBSE 2026
Reading time3 minutes
Word count573

Learning outcomes

Vocabulary

WordMeaning
SequenceAn orderly collection of items, where each item is indexed by an integer.
StringA sequence made up of one or more Unicode characters (letters, digits, whitespace, symbols).
UnicodeA character encoding standard that supports a wide range of characters from different languages.
IndexingA technique to access individual characters in a string using their position (index).
IndexErrorAn error raised when trying to access a string index that is out of its valid range.
TypeErrorAn error raised when an operation is performed on an object of an inappropriate type (e.g., non-integer index).

The complete chapter text is read in the official NCERT PDF viewer below (streamed from ncert.nic.in). This page provides NCERT Help study material — summary, vocabulary, practice questions, and FAQs — not a full reproduction of the textbook.

Read chapter online

This PDF is loaded from the official NCERT website (ncert.nic.in). Use the page buttons below to read — download is disabled on NCERT Help.

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 …

Practice questions

  1. How can you create a string in Python? Answer: Strings can be created by enclosing one or more characters in single quotes ('), double quotes ("), or triple quotes (''' or """).
  2. What is the index of the first character in a string? Answer: The index of the first character in a string is 0.
  3. What happens if you try to access an index that is out of range for a string? Answer: An IndexError is raised.
  4. How can you access the last character of a string using negative indexing? Answer: The last character can be accessed using the index -1.

Frequently asked questions

What is a string in Python?

A string is a sequence of Unicode characters, used to represent text. It can include letters, numbers, spaces, and symbols.

How are strings created in Python?

Strings are created by enclosing characters in single quotes (' '), double quotes (" "), or triple quotes (''' ''' or """ """).

Can strings span multiple lines?

Yes, strings can span multiple lines when enclosed in triple quotes.

How do you access characters within a string?

Characters are accessed using indexing, with the first character at index 0 and subsequent characters at increasing positive integers. Negative indices can be used to access characters from the end of the string.

What is the difference between positive and negative indexing in strings?

Positive indexing starts from 0 for the first character and increases towards the end. Negative indexing starts from -1 for the last character and decreases towards the beginning.

What error occurs if an invalid index is used for a string?

An IndexError occurs if the index is outside the valid range of the string.

Does Python have a separate character data type?

No, Python does not have a separate character data type; a string of length one is considered a character.

Related resources

Important topics

String definition and creation Positive and negative indexing IndexError and TypeError handling

Topics covered

Introduction to Strings String definition String creation (single, double, triple quotes) Multi-line strings Accessing characters Indexing (positive and negative) IndexError TypeError

NCERT Class 11 Computer Science — Computer Science — Chapter 8 — Strings. Verified by NCERT Help Editorial Team. Reviewed on 29 Jul 2026. Last updated 10 Aug 2026.