1
00:00:00,450 --> 00:00:08,070
In the previous video we built this function here which gets a phrase as input so a string and if you

2
00:00:08,070 --> 00:00:11,760
execute the function it will return of that version of the string.

3
00:00:11,820 --> 00:00:18,630
Now the output of the program that you are building in this section is going to ask for this phrases

4
00:00:18,660 --> 00:00:22,680
over and over again as in the form of user inputs.

5
00:00:22,680 --> 00:00:25,860
So we are talking about getting user input from the user.

6
00:00:26,220 --> 00:00:34,560
And since that is happening repeatedly, we have a hint here that we are talking about a loop and sees

7
00:00:34,560 --> 00:00:35,670
this loop,

8
00:00:35,700 --> 00:00:43,140
so when the user enters \end the loop ends with that string that means we're talking about

9
00:00:43,140 --> 00:00:51,750
a conditional loop that makes us think about while loops because a while loops work on a condition basis.

10
00:00:51,750 --> 00:01:04,290
So let's say the while loop will run all the time so it will ask for user input. Input(say something:)

11
00:01:04,950 --> 00:01:09,300
a colon and make some space early just for decoration.

12
00:01:10,740 --> 00:01:14,320
So what happens if the user enters some input.

13
00:01:15,210 --> 00:01:18,300
Well first we want to check if that input,

14
00:01:19,710 --> 00:01:29,790
if that user input is actually the special string end.
If that is the case we want to break the loop.

15
00:01:32,790 --> 00:01:33,240
Else

16
00:01:35,980 --> 00:01:38,980
what we want to do otherwise.

17
00:01:39,610 --> 00:01:45,070
So you so those sentences there that they looked like a list.

18
00:01:45,190 --> 00:01:47,160
So it was several of them.

19
00:01:47,350 --> 00:01:53,770
That means we were talking about having a bunch of items and when you think about many items you think

20
00:01:53,770 --> 00:01:55,050
about the list.

21
00:01:55,150 --> 00:02:02,980
So maybe we want to store those phrases that the user enters in a list.

22
00:02:02,980 --> 00:02:03,990
How can we do that.

23
00:02:04,030 --> 00:02:10,060
What we can do that by starting with an empty list outside the loop.

24
00:02:10,780 --> 00:02:14,320
So python will execute the function definition.

25
00:02:14,470 --> 00:02:19,580
This we don't need it anymore because we just used it when we tested the function.

26
00:02:19,840 --> 00:02:23,640
So once the function definition is read by Python.

27
00:02:23,710 --> 00:02:25,760
We are not calling the function here.

28
00:02:25,930 --> 00:02:29,560
We are going to create an empty list and then start the loop.

29
00:02:29,560 --> 00:02:31,430
The user will be prompted with a message.

30
00:02:31,540 --> 00:02:35,880
If a string that the user enters is this we're going to break everything.

31
00:02:35,950 --> 00:02:42,760
So the loop will end. Else if that string is not what the user entered.

32
00:02:42,890 --> 00:02:44,620
Else we want to

33
00:02:47,320 --> 00:02:53,500
append the user string so user input into the results list.

34
00:02:54,880 --> 00:02:56,820
So at the end of the loop,

35
00:02:56,920 --> 00:02:58,840
so I unintended here.

36
00:02:58,840 --> 00:03:05,310
This is after the loop terminates which happens only when the break happens.

37
00:03:05,380 --> 00:03:08,550
So when the user enters this. After the loop terminates

38
00:03:08,550 --> 00:03:11,920
we're going to have a list with lots of data.

39
00:03:14,410 --> 00:03:18,730
So prints results.

40
00:03:18,730 --> 00:03:21,210
How are you.

41
00:03:21,220 --> 00:03:27,760
Weather is good, and end. And this is what we got.

42
00:03:28,130 --> 00:03:28,370
Okay.

43
00:03:28,380 --> 00:03:32,960
I know these are the streams that the user enterd.

44
00:03:33,010 --> 00:03:35,200
So how can we get the actual strings?

45
00:03:35,200 --> 00:03:36,750
Well that is very easy.

46
00:03:36,760 --> 00:03:41,820
Here we are spending to the list the row strings that the user entered.

47
00:03:42,190 --> 00:03:47,070
But we have a function that can convert those strings into sentences.

48
00:03:47,110 --> 00:03:54,390
So let's use that function so we are going to append the output of the function, to get the output you

49
00:03:54,390 --> 00:03:56,860
need to call the function. To call the function you need

50
00:03:56,880 --> 00:04:01,530
an input for the function, the input here is the user input.

51
00:04:01,530 --> 00:04:03,240
Just like that, execute again.

52
00:04:08,700 --> 00:04:16,850
End and we got this output as we expected.

53
00:04:16,910 --> 00:04:18,800
So we are making good progress.

54
00:04:18,800 --> 00:04:21,750
However we don't want a list output here.

55
00:04:21,770 --> 00:04:26,000
We just want a string output without those square brackets.

56
00:04:26,000 --> 00:04:35,030
So how can we actually merge or concatenate all the strings to make a single text as a string?

57
00:04:35,030 --> 00:04:36,290
Let's do that in the next video.

