...

/

Introduction to Strings

Introduction to Strings

Learn about string creation, usage, indexing, and properties.

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"""
Press + to interact
# simple strings
msg1 = 'Educative'
print(msg1)

If there are characters like ', ", or \ within a string, they can be retained in two ways: ...