Page 123 - Trackpad_V2.1_class8
P. 123

1.  Tick ( ) the correct option.
                    a.  Which type of function is append( )?

                         (i)  Built-in                                    (ii)  User-defined
                        (iii)   Not a valid function                     (iv)  None of these
                    b.   Which of the following are used to represent special characters that cannot be directly inserted into
                        a string?
                         (i)  Positive indexing                           (ii)  Escape sequence
                        (iii)  Negative indexing                         (iv)  String operators
                    c.  Parameters in function are separated by:

                         (i)   Colon (:)                                  (ii)  Comma (,)
                        (iii)  Semicolon (;)                             (iv)  Hash (#)
                    d.  Which of the following is the built-in function?

                         (i)  len()                                       (ii)  upper()
                        (iii)  lower()                                   (iv)  All of these
                    e.  Which operator is used to repeat the string for a given number of times?
                         (i)  String Concatenation Operator               (ii)  String Replication Operator

                        (iii)   len()                                    (iv)  None of these
                 2.  Fill in the blanks using the words from the help box.


                                              Function,  append,  string,  lower

                    a.   The _______________ function inserts the element passed to it at the end of the list.

                    b.   _______________ can be defined as a block of reusable code that performs a specific task.
                    c.   The _______________ function converts all uppercase letters to lowercase.

                    d.   A sequence of characters that are enclosed or surrounded by single or double quotes is known as
                        a _______________ .

                 3.  Answer in one or two words.
                    a.  Which function returns a string with the first character in capital?         _______________
                    b.  Which type of list is used to place different data types in it?              _______________
                    c.  Which statement is used to remove a whole list or elements of a list?        _______________

                    d.  Which keyword is used to begin the function definition?                      _______________
                    e.  Which type of function takes parameters but does not return anything?        _______________
                 4.  Think and answer.
                    a.  Which operator is used to access the elements of a list? Give an example.

                        ______________________________________________________________________________





                                                                                   Functions, String and List in Python  121
   118   119   120   121   122   123   124   125   126   127   128