Page 138 - TP_Play_V2.2_Class8
P. 138

Timeline


                         A list is a collection of data elements in a specific order.

                         Traversing means accessing or visiting the elements of a list.
                         A nested list can be traversed by using the index operator.

                         Negative indexing starts from the index of -1, which is 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 (=).
                         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).
                         Joining,  repeating, slicing, and comparing lists are some of the several operations that can be
                       performed on lists.







                     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.  :



                  136  Plus (Ver. 4.0)-VIII
   133   134   135   136   137   138   139   140   141   142   143