Hi, everyone. In this module, we start the list and tuples. In Python standard libraries, there are three non-primitive data types that are most frequently used in Python coding. They are lists, tuples, and strings. They are also called iterables because they are ordered and we can take one element at a time and those contained in iterables are called arguments or elements because they are ordered. Each element is indexed by integer numbers. The indexes start from zero to certain number which represent the end of element in a sequence. First, let me explain the list, the concept, and how we can manipulate data contained in lists. That's what I'm going to explain here. Lists typically store homogeneous data. They're ordered, as I said before. But they don't have to be homogeneous because lists also can contain heterogeneous data and each element are mutable. It means that we can change element contained in a list. In order to define this two, we need to use square brackets. Elements contained in a list, they're denoted by square brackets. At image, the elements are contained. Elements have one index starting from zero and each element is separated by a comma. Here's an example of a list, I named it List 1. It contains 1, 2, 3, 4, 5, 6, 11, and our two character a and b. They are actually strings because they're character information. This List 1, list object contains numbers and strings. It means that this list store heterogeneous data. Let me ask you this one, then what happens here? I asked the type of that list. Class is list and those element contained in List 1 is printed here. Even though I didn't insert here empty space in front of four and five, when I printed List 1, an empty space is inserted before the two numbers. You don't have to worry about inserting empty spaces when you line up the elements contained in a list. Also as I said before, list has index, index starting from zero. In Python, all index start from zero. Think about we already created List 1 and index is denoted by, again, square bracket. The index number 1, which number will be printed because index zero is one here? Index 1 is Element 2, so value 2 will be printed. What about seven index? What is the seven? Zero, 1, 2, 3, 4, 5, 6, 7 a will be printed. This second line, slicing certain elements from Index 2-5. As I said before, in Python, the last index is not inclusive. It means that the element that has indexes from 2-4 will be printed. Here 0, 1, 2; from 3, 4, 5 will be printed. Let's execute this here. As I said before, two and a are printed and 3, 4, 5 are printed because of the second line. The object is sliced list. The 3rd line, it slices from 0-6 element. Because as I said before, seven is not inclusive. This element, till 11, will be printed. Another slicing is from four to. There is no number ending number. It means that the remaining elements. All remaining element will be printed from four. 0, 1, 2, 3, 4 from five and all other remaining elements are printed here. Another indexing method is from our backward indexing. If you want apply backward indexing, you add negative sine. Negative one means that you are taking the last element, which is B, so it is printed here. The starting number is negative four. Negative one, 2, 3, 4, 6 from six to there is no ending index. It means that the remaining all element will be printed from 6, 11AB, which is here. Another one is, you can add index numbers 1 plus 2. It means there are 3, from 3 to end. From element 4, 5, 6, 11, a, b will be printed, so which is shown here. Using index, there are many ways to use index for slicing. In this case, how many elements contained in the list? 1, 2, 3, 4, 5, 6, 7, 8, 9, nine elements are contained in list 1. But watermark element is so many. But each to count, in that case, you use this length function. Then obviously it returns the number of elements contained in our list. Also list, as I said before, it is mutable, changeable, modifiable. Using index number, you can replace the element with six index will be replaced by string c. Let me print it. What happens? 11 disappeared. instead, c appears, is supposed to be 11, but actually it is replaced by c. It is a way of replacing changing existing list. Here's one more thing I need to explain, what about you are calling non-exciting element by using an index. There are no nine index because even though there are nine elements, indexes starting from zero. The last index of last element is nine. What you are calling on element which is not existing in our list, then error message it comes of list index out of range. This is what you will see. Let me explain how to create list here, listed 2 is empty list. No element announced. One way of adding element in that list is simply append 11. It means that 11 will be added to list 2. Here you see. Another way of doing that is using augmented addition. But in this case, the outcome is the same, but you should remember, you need to create a list with only one element 11. It is more like adding two list. One list is empty and another added or adding list has just 11 one element. You are adding two list. Augmented addition means that you add 11 to list 2 and overwriting list 2, so is actually list 2 now contains 11. Another way of creating Lester using follow here. You see actually I kept making a list of two with zero element and then adding this one. Now 11, 12, 13 elements are contained in a list 2. Surely you can use this way append. But in this case you are writing I without bracket. Surely you can also use extend. For example, extend is a way of adding multiple element. In case of append, you can add one element at a time. But what if you want to add multiple element? In their case, you can use extend. This one gives you the same outcome. Which one are you going to use? It is up to you, is your preference. Here's another case of creating element, but at this time a list contains string. As you can see, AI Coding, which is actually this string, is itself a sequence of characters. An empty space contained within that string. So if you run this one, what happens? First, List 3 creating without element. Then you are adding this string. What will be contained in the List 3? Let's see here. Each character treated as an element, even empty space is treated as an element of that string sequence. If you add a string, actually each component of that string is treated as an element. But what if you want to treat the whole string as an element? For example, if you want to add this string as one element, in that case, you'd need to use bracket because it means that this list contains only one element, which is this string AI Coding 1. Let's execute what happens. At this time, AI Coding 1. Two words is contained as an element in List 3. You can do so also using append. Concatenating two lists. Concatenating two lists means that adding two lists. Surely, you don't have to be two. It can be any number of lists. List 1 and 2, which is adding two lists. Let's see what happens if we execute this cell. This one. Yeah, two lists from one to string b which is List 1, 11, 12, or 13 that is two lists are combined. There are alternative ways of concatenating two lists. You can use either extend or augmented addition. You can use one of the two alternatives. Obtaining index and elements, they are paired. Think about this for loop, i is a loop index and range and lengths number is taken from List 12. List 12 is here, the addition of two lists. What would be the lengths of List 12? 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12; 12 elements. Index i here for loop index will take from 0-11, and either be assigned to here. You are taking one element at a time by using index here and we are printing horizontally. They are contained within parenthesis. What you see here is this one, 0, 1. The first one is the index and this is the element. What is the ending element? Eleven and the last item is 13. I explained so far the concept of a list and how to manipulate elements contained in a list. Before finishing this video clip, let me give you a review question. True or false; a list name, which is object name, contains how many letters? Eight letters, which is my first name, is given here. Then what is the name? The index is five. Is it element g or not g? This is equal two sign. What is the answer? True or false? Because name 5 is indexes starting from 0, 0, 1, 2, 3, 4, 5. It should be s, s is not equal to g. Actually, the answer is false.