‫Now you can also create lists using special functions such as range.
‫So if I write a list.
‫And then record a right range in range.
‫I have to provide the starting point, stopping point and the step.
‫So if I provide zero as my starting point, then as my stopping point and step as to.
‫And if I run this range will provide me an output.
‫Of 0 to 4, six, eight, and I'm using this keyword to convert this output and the form of list.
‫So we can create another variable L for equal to.
‫List.
‫Range 0 to 10 with a step two.
‫If we print our variable l for.
‫We can see zero is our first element two, four, six and then eight.
‫If we want to sort it in the descending order, we'll write four dot sort.
‫So it is a function.
‫And the argument here is reverse equal to true.
‫If we don't give this reverse equal to true, it will automatically sorted in the ascending order.
‫But we want it in the descending order.
‫That's why we are providing argument reverse equal to two.
‫Now if we check four, you can see.
‫It is sorted in the descending order.
‫Our first element is eight, which is the largest and the last element is zero.
‫The smallest element.
‫If we want to add more elements into our list, we can use a pen function we'll write for.
‫Dot append.
‫And then Brackett, you mentioned the variable.
‫Here we are writing ten.
‫This add the value ten at the end of the list.
‫As you can see, we have ten at the end of the list.
‫If we want to change the value of any element, we can just write.
‫That element address So L4 Square record zero.
‫This is our first element and we want the value of this element to be three.
‫So if we write equal to three.
‫It will automatically change the value of of the first element to three.
‫So earlier it was eight.
‫Now the value is three.
‫If we want to change values of multiple elements, we can write.
‫And for.
‫We want to change the value of second and third.
‫So we'll write one.
‫Colon three.
‫This means element second and third.
‫Since three is not included and one is included.
‫And then in the square record.
‫We can write the values.
‫So for example, if we write five comma seven.
‫Now we are replacing the 6 to 5 and this 4 to 7, we run this.
‫You can see the values are not changed.
‫In a way.
‫We are providing another list to replace the elements of this list.
‫Now, if we want to insert an element, a specific index, we'll do this by using a keyword insert.
‫So if we write for insert.
‫And we want to insert this element at the first position.
‫So we'll write zero since zero is our first position and we'll write 15.
‫So if we write 15 in double quotation, this means we are passing this element as a string.
‫So let's do this.
‫Fourth.
‫You can see we have inserted this 15 string.
‫At the first position and now all my other elements are shifted by one in space.
‫Now, if we want to remove element of this string, we can do this by using two commands.
‫First is the remove function and the second is the delete function.
‫Remove function will remove the value of that element.
‫So for example, if I write remove bracket three and four remove three, it will first search the elements
‫which have the value.
‫Three.
‫In that case, this is the second element.
‫So it will delete this second element.
‫If we run this.
‫Whereas if I am using delete, it will delete the position of that element.
‫So for example, if we write del comma L for.
‫And then I have to specify the location.
‫So if I write zero, that means the first location will be deleted.
‫So if we run this.
‫And again, you can see the thing is now deleted.
‫We are only on the five, 7 to 0 and ten are remaining.
‫Now, if you want to know more about this, you can write help.
‫Help is a key word you can use anywhere.
‫So you can write health and record.
‫You can write list.
‫And if you run this.
‫You will get all the information about list we are not going to discuss all year.
‫And just a quick tip.
‫If you want to remove your output, just select the said, convert it to Rwanda and then again, convert
‫it to code and now your output is gone.
‫So if you have some large output, you can you probably want to do this.