← Back to articles
Strings in Python: it’s not as simple as it seems
To novice developers, strings usually seem to be just about the simplest thing in a programming language. Perhaps this is because learning a new language often begins with displaying the string ‘Hello, world!’ on the screen.
‘It’s just a set of characters enclosed in quotes!’ — a junior Python developer usually exclaims.
But in Python, things are a bit more interesting. And behind the simple syntax lies a whole host of possibilities, rules and nuances. What’s more, if you look more closely, you’ll find that Python has a whole menagerie of string representations and their associated features.
Hello, I’m Evgeny Bartenev, author and technical lead of the ‘Python Developer’ course at Praktikum. In this article, I’ll take a step-by-step look at the different types of strings in Python, how they differ from one another, what possibilities they offer, and what pitfalls you might encounter when working with them. We’ll discuss both basic usage and the important details that every developer should bear in mind.
‘It’s just a set of characters enclosed in quotes!’ — a junior Python developer usually exclaims.
But in Python, things are a bit more interesting. And behind the simple syntax lies a whole host of possibilities, rules and nuances. What’s more, if you look more closely, you’ll find that Python has a whole menagerie of string representations and their associated features.
Hello, I’m Evgeny Bartenev, author and technical lead of the ‘Python Developer’ course at Praktikum. In this article, I’ll take a step-by-step look at the different types of strings in Python, how they differ from one another, what possibilities they offer, and what pitfalls you might encounter when working with them. We’ll discuss both basic usage and the important details that every developer should bear in mind.
Read full article on Habr →
15.05.2026