BaseCodeByte
Back to Python course
PyValues and TypesBeginnerLive Python10 min

Strings

Work with text values and common string display methods.

Explanation cell

Strings represent text. Python strings can be changed for display using methods such as upper(), lower() and title().

text valuesstring methodsupper/lower/title

Quick tip

String methods return a new display value; they do not rewrite the original text unless you assign it.

Common mistake

Most early errors come from unmatched quotes, misspelled names or indentation.

Code cell

Starter code · Ctrl+Enter runs · Ctrl+Shift+Enter tests

Python runtime loads on first run

Output cell

Run your code to see output.

Run your code to see output.

Test cell

Tests run against the actual Python output.

Run tests to check your code against the lesson goals.

Practice cell

Try this

Create a name variable and print it in title case.

Expected output

PYTHON
python