Page 162 - Plus_V2.2_C8_Flipbook
P. 162

test Your skiLLs



                  1.  Tick ( ) the correct option.

                     a.  Which user-defined function takes parameters and returns output?

                        (i)   type1                                     (ii)  type2
                        (iii)  type3                                    (iv)  None of these

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

                     c.  Which operator is used to repeat the string for a given number of times?

                        (i)  +                                          (ii)  *
                        (iii)  &                                        (iv)  %

                  2.  Fill in the blanks using the words from the help box.


                                                     Function, upper(), string, lower

                     a.   The ____________ function converts all lowercase letters to uppercase.

                     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 consecutive sequence of characters which are enclosed or surrounded by single or double
                        quotes is known as a ____________.

                  3.  Short answer type questions.

                     a.  What are functions?
                          ______________________________________________________________________________

                     b.  Define strings.
                          ______________________________________________________________________________

                     c.  What is a List?
                          ______________________________________________________________________________

                  4.  Long answer type questions.

                     a.  Write the components of a function.
                     b.  How can we call a function in Python? Explain using an example.

                     c.  What are the different types of functions? Explain in detail.

                     d.  Write any two built-in functions to manipulate strings.




                  160   Premium Edition-VIII
   157   158   159   160   161   162   163   164   165   166   167