



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




2
2
Looking inside lists: colors= (^) To print the complet list: print (colors). (^) To print the first element of the list: print (colors). (^) To print elements starting from second element to fifth element: print(colors). (^) To print elements starting from third element: print(colors). (^) The last member of a list can also be accessed by using the indes -1: print(colors)
5 List built-in functions o (^) The len ( ) function takes a list as a parameter and tell us the number of elements in the list:Print(len(list name)) o (^) Max( ) returns the item in the item in the list with the maximum value:Print(max(list name)) o (^) Min( ) returns the minimum value: print(min(list name)). o (^) List.append( ) appends (add) the element to the end of the list: list name.append(12)/ Print(list name). o (^) List.remove( ) deletes the element of the list: list name.remove(5)/ Print(list name). o (^) List.reverse( ) reverses the objects of the list: list name.reverse( )/Print(list name) o (^) List.sort( ) to arrange the values in ascending order: list name.sort( )/Print(list name) 5