loops and lists mylist [ - print(mylist[ ]print(mylist[ ]print(mylist[ ]len(mylistlength of list the last line uses the built-in python function lenwhich returns the number of elements in the list this function works on lists and any other object that has natural length ( strings)and is very useful other built-in list operations allow usfor instanceto append an element to listadd two lists togethercheck if list contains given elementand delete an element from listn [ append( add new element at the end print(nn [ extend at the end print(nprint( in #is the value found in ntrue/false del [ #remove the first item from the list these list operationsin particular those to initializeappend toand index listare extremely common in python programsand will be used throughout this book it is good idea to spend some time making sure you fully understand how they work it is also worth noting one important difference between lists and the simpler variable types we introduced in for instancetwo statementssuch as would create two integer variablesboth having value but they are not the same variable the second statement = will create copy of and assign it to band if we later change ba will not be affected with liststhe situation is differentas illustrated by the following examplel[ [ , , , [- [ hereboth and are listsand when changes also changes this happens because assigning list to new variable does not copy the original listbut instead creates reference to the same list so and arein this casejust two variables pointing to the exact same list if we actually want to create copy of the original listwe need to state this explicitly with copy(