 We talked slightly about this in the last section where we were talking about how strings are objects But to be a little bit more specific strings are Lists lists are objects as well But the entire point of that is that means that every single character Inside of a string has an associated index to it and so just like any other list if I were to Use those square brackets for my string It's going to give me back the value at that particular index. So in this case index 4 is this little oh And we can start to do a number of different things, but I do want to clarify that there is some Rules to working with these strings the first one is that big fancy $5 word Strings are immutable which means that you can't just change them. You can't update them like we were doing with Lists so if I tried to come in and do that same jello world from a previous video that does not work But I can do something like this and we'll get into what this fancy magic is in a second in fact, why not that is known as Slicing Okay, big fancy Definitional term and then we'll actually play with this for a second slicing basically says that if I give it this Parameter or if I use a list so just to kind of work off of this if I Give a list some in colon M What I'm saying is I want to create a sub list from my list and I need to specify a starting point and a stopping point so in Start Point M Stop Point so with hello world for example if we take a look at this example String two to ten If we jump back over here that says to start at two and go all the way to Ten not including ten so I'm gonna stop it right here. This technically should start Here and what we should get is exactly that the element starting at the two index Going all the way through until we get to the element at the nine index and we get a sub list So you can see we can start to do a number of different aspects What does this one do? Explore what that one does if you don't give it a starting point or an ending point See what happens But let's just explore sort of this for a second I've obviously been traversing through the days of the week But this is a list which means I can do list slicing with this list so Same kind of thing you can go on here if I said days Two two there are tens. I'll shorthand it to five Days two to five Again, this is saying I want to create a sub list of the elements starting at the two index Conveniently I have that here starting at the two index Giving until five so getting two five so I should have Tuesday Wednesday and then Thursday Tuesday Wednesday Thursday nice. I can also add in some steps to this So I could say something like days One colon six colon two Now what this is saying is starting at one going until six going two times and So or not going two times, but starting at one Going to six so going to the last one but Going two steps each time so skip over Tuesday. Give me wins Give me Wednesday skip over Thursday. Give me Friday. So it'll do just that you won't see That too often it does exist like it beyond going every other like you will never see someone do a one six four Or something like that even when you're Going with higher level ones. It does work. You can do it. I Don't I don't typically use it One of the ones that I will do a lot that is almost So well known that I you know, I would never Ask it as a question on an assignment, but it's almost always needed Black magic welcome to black magic or list comprehension with Python so what is going on here, right? Okay, so the first thing that we're dealing with is the fact that Python allows us to do negative indexing And the way to think about this is that If we were to count this as negative one that would be negative two negative three negative four five negative six negative seven and so Python allows us it's you know, I'm not I'm just saying like Python allows us to do that thing. Okay But what that allows for is then using sort of these lists comprehension remember I Said that the first colon represents the starting point the second colon represent represents the ending point and then The last point are in this version is saying how to step through the list So skip every other element. Well in this case remember That is just going to tell me Give me the entire list from start to stop Since they're blank. It's just gonna go from the starting point to the ending point If I came in and then said something like negative one Well, oh in this case, it's saying Give me everything from the starting point to the negative one Index and again, we're dealing with the fact that Python allows negative one indexing Saturday is the negative one index. So give me everything up to the negative one Again, we're just dealing with slicing again, you're This is the extent you'll see of ever someone Going elaborate with like a two colon list comprehension traversal thing Just because it's so well known But you may start to see and if you're thinking about your project this may be beneficial for I don't know getting a subset of a list