 Now that we've introduced this idea of complex data types known as objects We're going to get into effectively the data type that we are going to be exploring for the rest of the semester something known as lists and the quickest way to think about a list is using another word it's a collection of of Values and what I mean by that is now when we're dealing with variables, you know, let's say for example, I had an X before X was just a single variable 42 or Hello, it was a string, but it was always just some single digit or single valued variable The variable was just some single value, but now that we're dealing with this idea of Collections of values were now saying that oh well this particular variable just to put it in here Numbers numbers could happen to have Multiple values associated to it. So in this case it has six values associated to a single variable well in that case we need a way to Deal with each one of those values and we do that through some new Terminology the first one and the second one the biggest one is this idea of something known as an index and then the second is Something known as element now element. It's just the value Associated or those values that are stored in the collection. So let's imagine we had the days of the week as Strings in a collection. Well Monday That is an element and it's just a you know again It's a spot in the list, but specifically now we're dealing with where it's located Inside of a list you're going to see Some associated Indices attached to them now one of the things that we have to do when we're dealing with programming is we start at Zero So if I was to start my list of weeks off at Sunday, then the index for Sunday would be zero and Then okay. Well, what's the day that follows? Sunday, it's Monday obviously so in that case it would just be one element over or one index over One and that would be our Monday, and then two would be Tuesday three would be Wednesday Four would be Thursday you sort of get the point But it's now that we have these indices to reference specific spots in Memory now we're gonna use a very basic case here for a second. Let's just imagine I have a list of numbers 8675309 Okay, well each one of those numbers if we're going super super super basic Each one of those numbers has or can be represented with 32 bits if we're thinking about once again Physical memory So just to draw out that memory stick one more time we're thinking about memory and We're thinking about that eight. So that would be zero zero zero Zero thinking in the top of my head Zero one zero zero. I think that's right. Don't quote me on that But the entire idea is those are all the ones and zeros needed to represent that eight then Right beside that would be some more zero so zero zero zero zero zero Four two zero Okay, so let me correct that because someone on the internet will freak out area So again, the entire idea is well when I have all of these elements In a list again if we're looking at it from the days of the week It's very easy to understand. Oh well Sunday and then Sunday ends and Monday begins What's really going on there is effectively we're saying in memory I need to skip some 32 bits to get to my next index So again, if you think about it eight is the zero index six is one seven is two five is three four five Six and I'm effectively saying if I want to access a particular element. I need to Go to some starting point wherever that starting point is in memory plus 32 in our case 32 bits because we're dealing with numbers times Some index so in the case of that eight start at the starting point because zero times 32 nothing one times 32 however 32 not eights but for our sake that would skip over these ones and zeros and then start right about here And it would go on and on and on again We're not dealing with the super complex memory, but the more important aspect to this is specifically We start counting at zero and we move on from there so How do we represent and work with lists? Well quite simply we are going to be utilizing Square brackets and the square brackets represent in Python. I'm dealing with a list Then I simply just pass in the values. I want at any particular Index so in this case Days of the week is the variable name And then I have Sunday Monday Tuesday Wednesday Thursday Friday Saturday for all of the different respective Elements in that list. Okay. Well now that I have a variable and I have created my list What can I do with it? That's where we start to get into accessing elements from the list in this case I Would still be using that variables name. That's just my way of associating You know again where in memory to start Then I would use the square brackets and give it The index that we're working off of so print days of the week three What would that be? Well, and if we look at the days of the week again, we start counting at zero one two three So this would print out Wednesday we can also store them in temporary variables just in case so I could Take that Wednesday if I don't want to type out days of the week Three every single time I need to work with that variable. I could just Save it as temp And now that we're again thinking about this we can also Manipulate our elements as well. So let's say for example for whatever reason We want to change Thursday into Thursday. We are paying our homage because you know I don't know Disney plus and Marvel and Loki Going on right. I don't know but we want to replace Thursday with Thursday. Well in that case again, just like we would do with making any variable if I had a variable X Five and then later on in my code. I said X is going to equal 10 I'm just changing the value of the variable. I don't want to change all of the days of the week I only want to change Specifically one value at a particular index. So again, I would put in square brackets the index and Wouldn't you know it? I now have access to alright. I've now changed Thursday into Thursday