Welcome to another video of our Python listeners, and today we're going to talk about Python lists,
a list in Python is an array of data strings or integers, and you can access these data using the name
of the list you created and the number of the element.
Let's create a small list with two strings and one integer.
The first element in an array starts from zero.
The second element is number one and so on.
Let's access the first element of this array, which is string.
Hello.
What about the second element?
Nice be careful if you access an element outside the scope of the array, which means it's not there,
you would get an error.
In this example, we only have three elements starting from zero to two, but we don't have element
number three.
Let's see what happens when we access that element.
As you can see, we got an error list and it's out of range now.
What if we want to add an element to our list?
We can do that by using a pen.
Let's add the string.
Howdy.
And it will become Illman number three.
OK, how to remove the last element then we can use that by using the pop function.
But how do we insert an element in a specific location in our list?
We can do that by using the insert function and we need to provide the value we want to insert and the
element number we want to insert that.
Let's insert the string blue after the string word.
Now, let's look through our list and print every element.
One by one,
we are going to use lists a lot later, so we need to get comfortable dealing with them.
We have reached the end of this lesson.
Thank you.
And so you in the next one.