00:01
Okay, so we want to write a program that takes two inputs, a string whose length needs to be greater than one, and an index.
00:09
First, we'll define a main here that will declare our string, and then we will call a function to reverse it from the beginning up to that index, and then a function that will reverse it at the end, starting at the index.
00:26
To start with, we want to make sure that the index that we're passing into our function, within the range of the string.
00:36
Otherwise, we would be out of bounds, and that would not work.
00:39
Next, we're going to use array slicing to actually do the reverse portion.
00:44
And there are three different parts of the array slicing that we're going to use.
00:48
First one here is x, colon, which means start at index x and go to the end.
00:55
Next is colon x, which means start at the beginning and go to x...