Page 134 - Plus V4 with Adobe class 8
P. 134

Timeline


                    A list is a heterogeneous collection of data elements.
                    Traversing means accessing or visiting the elements of a list.

                    A nested list can be traversed by using the index operator.
                   Negative indexing means the index of -1 refers to the last element of the list: the index of -2 refers to
                 the second last element.
                   Lists are mutable, which means the elements of a list can be changed or new elements can be added
                 to a list by using an assignment operator (=).

                   Joining,  repeating, slicing, and comparing lists are some of the several operations that can be
                 performed on lists.
                   The various built-in list methods are: append ( ), extend( ), insert(x, a), remove( ), index( ), count( ),
                 pop([i]), copy( ), clear( ), sort( ), reverse( ).
                 The various built-in list functions are len(list), max (list), and min(list).








               Choose the correct option.

                1.  Which of the following indicates an empty list?

                         a.  { }                                       b.  [ ]

                         c.  ( )                                       d.  <>


                2.  Which of the following lists contains another list?

                         a.  Nested list                               b.  Empty list

                         c.  Joint list                                d.  Both a. and b.

                3.  Which of the following does negative indexing mean?

                         a.  Index of -0 refers to the last elements of the list


                         b.  Index of -1 refers to the last elements of the list

                         c.  Index of -2 refers to the last elements of the list

                         d.  Index of -3 refers to the last elements of the list

                4.   Which of the following operators is used to access the list elements within a specific range of
                   positive and negative indexing?

                         a.  #                                         b.  =

                         c.  *                                         d.  :



            132  Plus (Ver. 4.0)-VIII
   129   130   131   132   133   134   135   136   137   138   139