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.

Press + to interact
print("Hello World")
print("Saynora, My Friend!")
print("This term is known as 'iceberg', your highness.")
print('And Tom said to me, "Eat while you are still young"')
...