Skip to content

Strings and f-strings

Python · Free lesson · No account needed

Step 1 of 9 · Start here

Strings and f-strings

Start here

A string is text in quotes. You can join strings with +, and Python has tools for text, such as len to count characters.

The neatest way to mix text and values is an f-string: put an f before the quotes, and any variable in curly braces is filled in.

name = "Amara"
print(f"Hello, {name}!")

You’re trying a free lesson. Your progress saves on this device. Create a free account to keep it everywhere and ask the AI tutor.