NCERT Class 11 Computer Science Computer Science: Chapter 8 — Strings
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
| Board | CBSE / NCERT |
|---|---|
| Class | Class 11 |
| Subject | Computer Science |
| Book | Computer Science |
| Chapter | Chapter 8 — Strings |
| Language | English |
| PDF type | NCERT Textbook |
| Session | CBSE 2026 |
| Reading time | 3 minutes |
| Word count | 573 |
Learning outcomes
- Understand the definition and properties of strings in Python.
- Create strings using single, double, and triple quotes.
- Access individual characters in a string using positive and negative indexing.
- Recognize potential errors like IndexError and TypeError when accessing string characters.
Vocabulary
| Word | Meaning |
|---|---|
| Sequence | An orderly collection of items, where each item is indexed by an integer. |
| String | A sequence made up of one or more Unicode characters (letters, digits, whitespace, symbols). |
| Unicode | A character encoding standard that supports a wide range of characters from different languages. |
| Indexing | A technique to access individual characters in a string using their position (index). |
| IndexError | An error raised when trying to access a string index that is out of its valid range. |
| TypeError | An 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.
Practice questions
- 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 """).
- What is the index of the first character in a string? Answer: The index of the first character in a string is 0.
- What happens if you try to access an index that is out of range for a string? Answer: An IndexError is raised.
- 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
Topics covered
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.