1
00:00:01,780 --> 00:00:02,230
Hi.

2
00:00:02,260 --> 00:00:05,600
Today we're going to have only one code experiments.

3
00:00:05,630 --> 00:00:11,290
That's because in the code exercises for today, you're going to have many exercises.

4
00:00:11,320 --> 00:00:15,250
So we want to adjust the time so you don't feel overwhelmed.

5
00:00:17,910 --> 00:00:21,240
This experiment is about dog strings.

6
00:00:22,800 --> 00:00:23,670
Which is.

7
00:00:25,090 --> 00:00:26,890
These strings.

8
00:00:28,820 --> 00:00:37,280
Today you learn that you can use these strings as documentation, strings also called the strings for

9
00:00:37,280 --> 00:00:38,300
functions.

10
00:00:39,140 --> 00:00:45,950
But these kind of strings with these triple quotes can also be used for another purpose.

11
00:00:46,820 --> 00:00:54,110
They can be used outside of functions, and you can store them as you do normally in a variable.

12
00:00:54,320 --> 00:00:57,470
So write three quotes make.

13
00:00:58,230 --> 00:00:59,340
A brick line.

14
00:00:59,490 --> 00:01:03,720
Another one, another three double quotes.

15
00:01:03,960 --> 00:01:08,160
And in between you can write multi-line text.

16
00:01:09,880 --> 00:01:19,270
So with normal strings, usually you use them for short pieces of texts, usually one line, but sometimes

17
00:01:19,270 --> 00:01:24,640
you might have texts which spans across multiple lines.

18
00:01:26,690 --> 00:01:28,940
In that case you want to use.

19
00:01:30,740 --> 00:01:32,510
Multi-line strings.

20
00:01:32,510 --> 00:01:39,710
So these are also referred to as multi-line strings when you use them outside of the functions.

21
00:01:40,160 --> 00:01:41,690
So, for example, let's say.

22
00:01:47,080 --> 00:01:53,020
We have this multi-line string, you can type in some text, several lines, whatever you like.

23
00:02:06,900 --> 00:02:07,650
Like that.

24
00:02:07,920 --> 00:02:12,720
And so there I have a multi-line string.

25
00:02:12,960 --> 00:02:14,820
Now, what is the benefit of this?

26
00:02:14,850 --> 00:02:25,650
Well, if you print text now and I run this program, you see, I'm going to get here the string as

27
00:02:25,650 --> 00:02:27,230
it is in here.

28
00:02:27,240 --> 00:02:35,310
So I didn't need to provide the special backslash and character, which creates break lines, because

29
00:02:35,310 --> 00:02:39,210
these break lines are recognized by Python by default.

30
00:02:41,190 --> 00:02:46,080
So if you had a normal string, first of all, it's not recognized.

31
00:02:46,080 --> 00:02:50,820
When you have it like that, you can get away with it by.

32
00:02:51,970 --> 00:02:57,340
Having here a backslash, a backslash here, a backslash there.

33
00:02:58,810 --> 00:03:00,250
And here as well.

34
00:03:02,160 --> 00:03:08,220
So everywhere you have a break line, you need that backslash and that would be fine.

35
00:03:08,220 --> 00:03:11,220
But if I run the script, this still?

36
00:03:13,210 --> 00:03:19,360
It's read as a plane string without brake lines.

37
00:03:19,990 --> 00:03:25,690
So if you want it break lines with a simple string, then you need to add.

38
00:03:27,500 --> 00:03:29,120
Before that you need to add.

39
00:03:30,530 --> 00:03:36,700
Backslash n run now principles of productivity is.

40
00:03:38,570 --> 00:03:42,140
In one line, and you can do that for all lines.

41
00:03:42,140 --> 00:03:51,560
So you see that it becomes impractical to use a single string when you want to to have multi-line text.

42
00:03:51,740 --> 00:03:57,860
Therefore, the solution is multi-line strings with triple quotes.

43
00:03:59,290 --> 00:04:04,150
So use multi-line strings whenever you have text which expands.

44
00:04:04,880 --> 00:04:06,830
In more than one line.

45
00:04:06,920 --> 00:04:08,600
Thanks a lot and see you later.

