Welcome back to Intermediate Python scripting. This is the second course, in Python scripting for DevOps specialization, alright? So in this module, we want to think about collections. Essentially, collections are the ability to store multiple values in a single variable, okay? So some objectives for this module, I want you to be able to implement a list in Python. By the time we're done with this module, you should also be able to iterate through that list. You should also be able to implement tuples and finally dictionaries in Python. And we'll talk about these different types of collections through the lessons here. Alright, so this first lesson, let's think about lists. So Python does not have a low level multi variable, data structure like arrays. Most languages have arrays. Python only has higher level data structures, that's designed to make it easier for you to program. Sometimes we give up a little performance, okay? And so a list is essentially a collection of values, and in the screen in front of you, you see three different initializations of the list. We initialize a list with the square brackets, so the first one creates an empty list. The second one has three strings red, green and blue. And the third one, creates a heterogeneous list, right? We've got a string, and integer, and a boolean, right? And I was trying to highlight here, that a list can be homogeneous, like the second one where all the values are the same data type. And that's how we deal with arrays and other programming languages. They have to be all the same data type. Lists allow us to be heterogeneous like this third example where they can be different data types. Alright. So when you want to access the elements in a list, you essentially do so with the variable name and an index, okay? Just like you would with an array. So some examples here is I create a list of grades. I got 100 and 99 and 98. Pretty good grades, right? The first one is always going to be zero, okay? And the last one is length minus one, okay? So however many elements you've added to the list minus one, but you can also always reference the last one with negative numbers. So you can go in the opposite direction. So minus one is the last one. Zero is the first one, Okay? When you want to loop through a list the specifics index, which is we've seen earlier, when we did our range statement. Essentially a range created a collection of numbers, okay? So similar syntax here we say four variable enlist and then we end up the statements, okay? And in those statements, variable will be the current instance, and we'll go through one instance at a time of elements in the list and run the statement. So I have a little example where I create a list, which is apple, banana, cherry. And then I iterate through them. And in the list, x becomes apple first. And so when I say print x, I get apple. The next time through x is banana, I'm going to print banana the next time it's third, cherry. I print cherry. We also have a length method. The length method is going to tell us the number of elements in our list. We can use this and other collections like two poles, but we'll see later on, okay? So some Texas basically Elian and in parentheses, you put the name of the list. So an example here is my friends. I set it to a list of Fred, Sally, Bill. I'm very popular. And then I print out the length of my friends so she'll print three, alright. A little review, lists are variable sized collections, of heterogeneous data types, meaning you can mix the different types of data, strings, integers, floats, bullying, that sort of thing. The length method tells you the number of elements in the list. Elements are index from zero to link minus one, okay? Alright, see you next module.