List in Python and List Functions | Python Tutorials for Beginners
Jenny's Lectures CS IT
we 'll be talking about A New Concept in Python that is Python list. What is list Why we use list some
features characteristics of list and as well as some functions or you can say methods of list that can be
applied on list. How to create a list and all we'll be discussing. A single list can contain many data
types like integer string Boolean float and as well as objects right now. Some characteristics are of list.
You can say like but these are ordered list are ordered. These items are ordered.. List is a data
structure. It 's a way of storing and organizing the data. It comes under sequence data type because it
contains sequence of various data types.. List is mutable, but list are ordered as well as we can access
how you can print the list now. If I I I want to print the store number, so simply print and name of the
list, so it will print this thing output would be something like this one two three four five in these
square brackets right. Index is what index of this is index will be started from 0, 0, 1 2 3 4..
Let 's create a new file Python list Dot py and we will be taking first of all our list suppose numbers so
suppose I have like only four elements 10, 0 minus one seven and if you want to print this, you can
simply print that 's it so mixed list is also possible like Jenny. IF I write something like this starting
index is 0 colon what is length of the list four. So if I write 0 colon 4. It will print simple the complete
list. If I do not write this 4 just blank 0 nothing so by default, it will take 4 to print the list. List slicing is
a form of string slicing. IF I write here 3. 1 then 2 so 0. It will Skip and it will print next element minus
one then one then two, then after second step. It is eight. 8, 8, 7 minus 1 0 10 will print till fifth index.
It should print right. So this is what extended slicing is. IF. You do not write five here. Then by default
it would print minus 67. Also because till the end it will. print right..
Using a pen, we can only add one data using insert function so here what we can do is insert, but in
append we pass only one argument. The value you want to add. AT one time we can add more than
one data at one at same time. AT. The end of the list you can add at one element at a time.. AT first
index I have 0, but I want to change the zero so what we can do like numbers. The name of the list. AT
which index you want to insert the data. First index is first index second index third index 45 46 47
rather than 0 minus one and seven, and all the other elements would be same right.. Pop remove will
search the item and just remove it will not return anything. There are many methods like appendix
stand insert remove pop. clear index count sort reverse copy and how to use these methods, so do n't
have to memorize these methods. You can just search, but you just have to go through these
methods.. The last element by default is the last element of the list. So if I want to print what this
Pope has removed from the list, then it will print that element also. It will return that element C 0. 0
has been removed and after that we have printed the list right
Jenny's Lectures CS IT
we 'll be talking about A New Concept in Python that is Python list. What is list Why we use list some
features characteristics of list and as well as some functions or you can say methods of list that can be
applied on list. How to create a list and all we'll be discussing. A single list can contain many data
types like integer string Boolean float and as well as objects right now. Some characteristics are of list.
You can say like but these are ordered list are ordered. These items are ordered.. List is a data
structure. It 's a way of storing and organizing the data. It comes under sequence data type because it
contains sequence of various data types.. List is mutable, but list are ordered as well as we can access
how you can print the list now. If I I I want to print the store number, so simply print and name of the
list, so it will print this thing output would be something like this one two three four five in these
square brackets right. Index is what index of this is index will be started from 0, 0, 1 2 3 4..
Let 's create a new file Python list Dot py and we will be taking first of all our list suppose numbers so
suppose I have like only four elements 10, 0 minus one seven and if you want to print this, you can
simply print that 's it so mixed list is also possible like Jenny. IF I write something like this starting
index is 0 colon what is length of the list four. So if I write 0 colon 4. It will print simple the complete
list. If I do not write this 4 just blank 0 nothing so by default, it will take 4 to print the list. List slicing is
a form of string slicing. IF I write here 3. 1 then 2 so 0. It will Skip and it will print next element minus
one then one then two, then after second step. It is eight. 8, 8, 7 minus 1 0 10 will print till fifth index.
It should print right. So this is what extended slicing is. IF. You do not write five here. Then by default
it would print minus 67. Also because till the end it will. print right..
Using a pen, we can only add one data using insert function so here what we can do is insert, but in
append we pass only one argument. The value you want to add. AT one time we can add more than
one data at one at same time. AT. The end of the list you can add at one element at a time.. AT first
index I have 0, but I want to change the zero so what we can do like numbers. The name of the list. AT
which index you want to insert the data. First index is first index second index third index 45 46 47
rather than 0 minus one and seven, and all the other elements would be same right.. Pop remove will
search the item and just remove it will not return anything. There are many methods like appendix
stand insert remove pop. clear index count sort reverse copy and how to use these methods, so do n't
have to memorize these methods. You can just search, but you just have to go through these
methods.. The last element by default is the last element of the list. So if I want to print what this
Pope has removed from the list, then it will print that element also. It will return that element C 0. 0
has been removed and after that we have printed the list right