September 2026
1051 pages
35h 4m
English
In addition to numbers, character strings, also referred to as strings, are extremely important in almost every real-world program. Strings allow text to be read, saved, edited, or output by the user.
To create a string, the associated text is written in double quotation marks:
>>> "Hello World"'Hello World'>>> "abc123"'abc123'
The single quotes that the interpreter uses to output the value of a string are an equivalent notation to the double quotes that we use and that you may also use:
>>> 'Hello World''Hello World'
Similar to integers and floats, you can also use operators for strings. For example, the + operator joins two strings:
>>> "Hello" + " " + "World"'Hello World'
The two different notations for strings ...
Read now
Unlock full access