Hi.
Today we're going to have only one code experiments.
That's because in the code exercises for today, you're going to have many exercises.
So we want to adjust the time so you don't feel overwhelmed.
This experiment is about dog strings.
Which is.
These strings.
Today you learn that you can use these strings as documentation, strings also called the strings for
functions.
But these kind of strings with these triple quotes can also be used for another purpose.
They can be used outside of functions, and you can store them as you do normally in a variable.
So write three quotes make.
A brick line.
Another one, another three double quotes.
And in between you can write multi-line text.
So with normal strings, usually you use them for short pieces of texts, usually one line, but sometimes
you might have texts which spans across multiple lines.
In that case you want to use.
Multi-line strings.
So these are also referred to as multi-line strings when you use them outside of the functions.
So, for example, let's say.
We have this multi-line string, you can type in some text, several lines, whatever you like.
Like that.
And so there I have a multi-line string.
Now, what is the benefit of this?
Well, if you print text now and I run this program, you see, I'm going to get here the string as
it is in here.
So I didn't need to provide the special backslash and character, which creates break lines, because
these break lines are recognized by Python by default.
So if you had a normal string, first of all, it's not recognized.
When you have it like that, you can get away with it by.
Having here a backslash, a backslash here, a backslash there.
And here as well.
So everywhere you have a break line, you need that backslash and that would be fine.
But if I run the script, this still?
It's read as a plane string without brake lines.
So if you want it break lines with a simple string, then you need to add.
Before that you need to add.
Backslash n run now principles of productivity is.
In one line, and you can do that for all lines.
So you see that it becomes impractical to use a single string when you want to to have multi-line text.
Therefore, the solution is multi-line strings with triple quotes.
So use multi-line strings whenever you have text which expands.
In more than one line.
Thanks a lot and see you later.