Page 98 - TP_V5.1_C8_fb
P. 98

d.  Which of the following is used to insert special characters that are invalid in Python?

                         (i)  Escape sequence                         (ii)  Strings
                        (iii)  Lists                                 (iv)  None 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 object passed to it at the end of the list.

                     b.  _______________ can be defined as a block of a reusable code that performs a specific task.

                     c.   The _______________ function converts all uppercase letters to lowercase.

                     d.   A sequence of characters which 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 function 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.
                      ______________________________________________________________________________________

                     b.  Define strings.
                      ______________________________________________________________________________________

                     c.  What are lists in Python? Define any two list functions.

                      ______________________________________________________________________________________

                      ______________________________________________________________________________________
                     d.  How can we call a function in Python? Explain using an example.

                      ______________________________________________________________________________________

                      ______________________________________________________________________________________

                      ______________________________________________________________________________________




                   96   Premium Edition-VIII
   93   94   95   96   97   98   99   100   101   102   103