Skip to main content

Working with text

Now that you know what strings are, let’s learn how to manipulate them. Python gives you powerful tools to work with text.

String operations

Concatenation (joining)

Repetition

String methods

Python strings come with many built-in methods - functions you can call directly on any string. These methods let you transform text, search for patterns, and clean up data. The best part? You can often guess what they do from their names - upper() makes text uppercase, replace() replaces text, and so on.

Changing case

Cleaning strings

Finding and replacing

Python has over 40 string methods! We’ve covered the most common ones here. For a complete list, check the official Python documentation.

Common mistakes

What’s next?

You’ve mastered working with data! Ready to make your programs smart with decision-making?

Control flow

Learn if statements and loops