Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,090 --> 00:00:02,060
Welcome back, ladies and gentlemen.
2
00:00:02,130 --> 00:00:05,790
And if you've made it so far, that's definitely an achievement.
3
00:00:05,940 --> 00:00:09,060
The materials in this chorus are not the easiest ones.
4
00:00:09,150 --> 00:00:11,940
And there were a lot of opportunities to leave the course.
5
00:00:12,150 --> 00:00:17,410
But still, you decided that you going to be commuted and you've made it so far at this point.
6
00:00:17,580 --> 00:00:19,410
And for that, I want to tell you.
7
00:00:19,530 --> 00:00:20,760
Well done.
8
00:00:21,330 --> 00:00:27,240
You've also passed the string section successfully and now there is just a little bit left to finish
9
00:00:27,330 --> 00:00:28,470
this section.
10
00:00:28,770 --> 00:00:30,000
So let's get ready.
11
00:00:30,090 --> 00:00:35,100
Get yourself something nice to drink and let's start with our awesome milestone.
12
00:00:35,580 --> 00:00:38,640
So this milestone involves strings.
13
00:00:38,910 --> 00:00:45,120
And particularly what we have to do is to write a program that checks whether a string entered by the
14
00:00:45,120 --> 00:00:47,460
user is a palindrome or not.
15
00:00:47,640 --> 00:00:53,910
And a palindrome is simply a term that says that if we read a given string from left to right, as we
16
00:00:53,910 --> 00:01:01,410
usually do, and if we read the same string from right to left, starting from the rightmost element
17
00:01:01,500 --> 00:01:07,980
up to the leftmost element, then we will see that both the strings will be the same.
18
00:01:08,190 --> 00:01:14,220
So, for example, if we take the word, let's say noon and we can see that if we will read it from
19
00:01:14,310 --> 00:01:17,770
the left to the right, we will get the word noon.
20
00:01:18,030 --> 00:01:21,270
But also, if we will read this word from right to left.
21
00:01:21,290 --> 00:01:21,550
OK.
22
00:01:21,690 --> 00:01:28,270
Starting from the rightmost element to the left one, we will see also the same word which is known.
23
00:01:28,530 --> 00:01:34,360
And what this means is that this specific string noone is actually a palindrome.
24
00:01:34,410 --> 00:01:37,830
So there will be a lot of different strings which are palindrome.
25
00:01:38,100 --> 00:01:39,700
No is one of them.
26
00:01:39,930 --> 00:01:42,310
But if it would take the word, let's say Tak.
27
00:01:42,450 --> 00:01:42,870
OK.
28
00:01:42,930 --> 00:01:49,380
This is our new string and we read it from Ray or from right to left or from left to right.
29
00:01:49,740 --> 00:01:51,330
We will get different strings.
30
00:01:51,480 --> 00:01:55,650
So this means that the word attack is not a palindrome.
31
00:01:55,920 --> 00:02:02,310
So once again, if we are to, let's say, summarize what a palindrome is, we can say that a palindrome
32
00:02:02,310 --> 00:02:06,240
is simply when a string equals two, it's reverse string.
33
00:02:06,510 --> 00:02:07,440
Is that clear?
34
00:02:07,590 --> 00:02:14,020
And the last note for palindromes that I want you to know when to to actually refer when you're writing
35
00:02:14,040 --> 00:02:19,320
your program is that palindromes can be of an even or an odd length.
36
00:02:19,560 --> 00:02:23,340
For example, we've seen that the word noon is of an even length.
37
00:02:23,370 --> 00:02:25,200
And it's actually a palindrome.
38
00:02:25,530 --> 00:02:27,810
And if we take the word let's say wow.
39
00:02:27,840 --> 00:02:29,880
Which is often odd length.
40
00:02:30,120 --> 00:02:32,390
We can see that it's also a palindrome.
41
00:02:32,400 --> 00:02:35,480
We can read it from right to left or from left, right.
42
00:02:35,760 --> 00:02:38,100
And we still get the same word, meaning.
43
00:02:38,160 --> 00:02:39,420
That's a palindrome.
44
00:02:39,690 --> 00:02:42,810
So make sure that you support both of these options are both.
45
00:02:43,080 --> 00:02:50,230
That strings may be palindrome even if the strings are even or odd length.
46
00:02:50,520 --> 00:02:55,990
So once again, what you have to do is to write a program that simply checks for Given's three and use
47
00:02:56,060 --> 00:02:57,390
palindrome or not.
48
00:02:57,750 --> 00:03:03,330
And basically, based on the result are your program should print a corresponding message.
49
00:03:03,450 --> 00:03:06,180
Now, there is more than just one way to solve it.
50
00:03:06,870 --> 00:03:07,800
So give it a try.
51
00:03:07,830 --> 00:03:09,370
Guys, I know you can do it.
52
00:03:09,660 --> 00:03:11,620
And I'll see you in the next video.
4834
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.