Search⌘ K
AI Features

Introduction to Strings

Explore the fundamentals of Python strings by understanding how to create, access, and manipulate them. Learn about string indexing, slicing, immutability, concatenation, and replication to build a strong foundation in text handling.

What is a string?

A Python string is a collection of Unicode characters. Python strings can be enclosed in single, double, or triple quotes, as shown below:

  • 'BlindSpot'
  • "BlindSpot"
  • '''BlindSpot'''
  • """Blindspot"""
Python 3.8
# simple strings
msg1 = 'Educative'
print(msg1)

If there are characters like ', ", or \ within a string, ...