Python List
Hello everybody, welcome to my new python tutorial. Today we are going to talk about list in python. List is a collection of data type that is ordered mutable and it always duplicate elements.
First of all list is created within square brackets [] within this brackets you can separate each elements by using comma ( ,) Let's see an example-
Now if you want to access an element within the list then you can simply refer the position index of that item, lets see in pycharm-
We can check the length (how many elements in your list) of a list by using len method-
If you want to add a new item in your list you can easily do by using "append" method-
By using "append" we can add a new item in the list which is usually located at the end of the available items. What if, we want to add a item or items in a specific index? "insert" method is the solution for this. Let's check below
মন্তব্যসমূহ
একটি মন্তব্য পোস্ট করুন