Strings

Let's look at the string data type in more detail.

Definition

A string is a sequence of characters enclosed in quotation marks.

In Python, you can use either single quotes or double quotes for strings. You can also insert single quotes inside double-quoted strings, and vice versa.

Python usually uses single quotes when printing out results.

There is no separate “character” data type in Python.

Get hands-on with 1200+ tech skills courses.