Strings

What is a string?

A string is a value made up of text. A classic example of a string is the code "Hello, world!". In Python, strings are enclosd using single or double quotes.

Why are strings important?

A string is one of the simplest data types in any language. Much of the information that's passed within and between programs is strings.

What is a substring?

Strings are treated as a collection of characters, so the string "123" is different from the numerical value 123. A substring is part of a string.

What can you do with strings?

You can perform many actions with strings, including concatenation (joining strings together, interpolation (inserting the value of a variable into a string), changing a string's case, stripping extra whitespace from a string, searching for a substring within a string, and replacing some characters in a string.