Real Python

Try It Yourself: Get the code examples you need to slice, format, and transform strings in your own code.

Almost there! Complete this form and click the button below to gain instant access:

Strings and Character Data in Python

Slice, Format, and Transform Text in Python

๐Ÿ”’ No spam. We take your privacy seriously.

ยฉ 2012โ€“2026 Real Python โ‹… Privacy Policy