14 List Operation and Implementation in Python programming

preview_player
Показать описание
So list in python is a kind of collection which allows us to put many values in a single variable.

You can also see that list is an ordered set of values.

So let's define our list.

So I'm going to just say x is equal to and you can define a list inside these square brackets. List is always define in SQUARE BRACKET.

And inside the list you provide some values.

So for example I'm going to provide the values 3 5 4 comma 9 comma 7 comma 10.

So this is how you can create a list in Python.

And when I press Enter it's going to create a list.
and then I just use X to get the list.
it's going

to provide me all the values in the list.

Now these values which are inside.
the list are called element.

So three is an element .
five is an element.
all these values in this list are all called element.

and all these elements are ordered by an index.

Index of list always start frrom 0.

So we can fetch the value which is at index 0.
using the square brackets.
once again with the variable

name.

And then right now right index 0.
it's going to give me that element .
which is saved at indexed 0.

So looking at this list 3 is at 0.
5 is at index 1.
4 is at index 2.
and so on.

**************************************************************************
please like and follow us in Facebook and Instagram.

Рекомендации по теме
visit shbcf.ru