1
00:00:00,560 --> 00:00:06,860
Let's talk about another method which is repeat.

2
00:00:07,340 --> 00:00:14,240
The name is even descriptive where after talking about repeat, you're going to have another coding

3
00:00:14,240 --> 00:00:16,219
challenge and repeat.

4
00:00:16,550 --> 00:00:23,930
What was the purpose for the coding challenge is that I want you to be familiar with functions because

5
00:00:23,930 --> 00:00:26,990
function is the code component when it comes to programming.

6
00:00:27,320 --> 00:00:33,440
So repeat it is used to repeat a certain text multiple times.

7
00:00:33,590 --> 00:00:37,790
So let's declare a variable called string const.

8
00:00:38,420 --> 00:00:41,090
My string is equal to.

9
00:00:41,120 --> 00:00:42,460
Let's say.

10
00:00:43,070 --> 00:00:45,260
Welcome to.

11
00:00:47,020 --> 00:00:49,300
I never take academy.

12
00:00:50,680 --> 00:00:51,590
Like that.

13
00:00:51,610 --> 00:00:55,300
So now how can I repeat this trick?

14
00:00:55,300 --> 00:00:56,110
Many times?

15
00:00:56,110 --> 00:01:06,340
So as easy as let me assign the results into variable chorus and on that SDR as my string dot repeat

16
00:01:06,670 --> 00:01:07,420
then repeat.

17
00:01:07,420 --> 00:01:12,010
You pass in the number of times you want to repeat this particular string.

18
00:01:12,010 --> 00:01:15,190
So let's count repeat at five as five times.

19
00:01:15,400 --> 00:01:24,520
So if I cancel that log the response, let's see see that it has repeated five times.

20
00:01:24,880 --> 00:01:27,130
The first one is where count and overtake.

21
00:01:28,080 --> 00:01:28,620
And.

22
00:01:28,620 --> 00:01:31,530
Yeah, yeah, this one, the first one is this one.

23
00:01:31,530 --> 00:01:34,860
The second one and then next one.

24
00:01:34,860 --> 00:01:36,150
Next one is that.

25
00:01:36,150 --> 00:01:37,830
So you can see that it's repeating itself.

26
00:01:37,830 --> 00:01:42,570
Let me use, let's say, a single line as welcome so that it be clear to you here.

27
00:01:42,600 --> 00:01:46,740
Let's work on and we see that there is no space in between then.

28
00:01:46,740 --> 00:01:47,010
Right.

29
00:01:47,040 --> 00:01:51,180
But has repeated itself that's about to repeat.

30
00:01:51,690 --> 00:01:55,190
Well, so let's have our coding challenge about repeat.

31
00:01:55,200 --> 00:01:58,950
So let me paste this one, the coding challenge here and now.

32
00:01:58,950 --> 00:02:01,620
Let's read through the next video.

33
00:02:01,650 --> 00:02:02,910
The first one is this.

34
00:02:02,910 --> 00:02:11,370
The first one sees that create a function to repeat a string number of times.

35
00:02:11,970 --> 00:02:19,890
The second criteria is that the function should take one argument that is a string to repeat a number

36
00:02:19,890 --> 00:02:20,790
of times.

37
00:02:20,790 --> 00:02:26,760
The function is to retain a string with the string repeated the number of times.

38
00:02:27,210 --> 00:02:30,390
The next coding challenge is going to be this.

39
00:02:30,390 --> 00:02:39,150
Let me pick this one here also, and it says that create a function to repeat a string number of times

40
00:02:39,570 --> 00:02:44,130
the function should we take two arguments string and a number.

41
00:02:44,130 --> 00:02:52,050
For the first one it takes in only a string and then going to repeat it many times base with a specific

42
00:02:52,050 --> 00:02:52,830
number.

43
00:02:53,100 --> 00:02:59,460
But for this one, you want to be more dynamic, meaning you pass in the string that you want to repeat

44
00:02:59,460 --> 00:03:01,980
and how many times you want to repeat.

45
00:03:02,400 --> 00:03:04,770
And the function should return a string.

46
00:03:04,770 --> 00:03:10,110
And then the function is to check if the number is less than or equal to zero.

47
00:03:10,110 --> 00:03:10,860
So.

48
00:03:13,440 --> 00:03:14,280
Good luck.

