What is String ?

A string is an immutable sequence of characters used to store and work with text. In Python, strings are enclosed in single quotes '...', double quotes "...", or triple quotes '''...''' / """...""".

s1 = 'Hello'
s2 = "Python"
s3 = '''Multi
line string'''

Introduction :

  1. Immutable (Fixed once created)

    You cannot change characters in-place; any “change” creates a new string.

  2. Indexed & Ordered

    Each character has an index (0-based), and you can access using indexing / slicing.

  3. Unicode Support

    Python strings store Unicode characters (supports emojis, non‑English letters, etc.).

  4. Iterable

    You can loop through characters one by one.

  5. Dynamic Length

    String length can grow/shrink by creating new strings.

Memory representation :

In Python, a string is an object in memory. The variable stores a reference (address) to that object.