Page 57 - Modular v1.1 Pyhton
P. 57

b.   We can call a function as many times as required.
                          c.   It makes debugging easy and makes the code efficient, both in terms
                               of time and memory.
                          d.   All of the above

                     3.   Which of the following are the components of Python function?

                          a.   Name of the function                     b.   Arguments
                          c.   Return Value                             d.   All of the above
                     4.   Which of the following is an example of built-In functions?

                          a.   print( )                                 b.   input( )
                          c.   Both a and b                             d.   None of the above

                     5.    Which of the following contains Python statement and makes a function to perform the required
                          task?
                          a.   Function Name                            b.   Parameters

                          c.   Body of the function                     d.   None of the above
                 B.  Write 'T' for true and 'F' for false.

                     1.  A function is a block of organised and reusable code.                          ……………………
                     2.  We can call a function as many times as required.                              ……………………

                     3.  A function name should be unique and easy to correlate with the task it
                         will perform.                                                                  ……………………

                     4.  The input given to the functions is referred to as parameters.                 ……………………
                     5.  A function can or cannot have any parameters.                                  ……………………

                 C.  Fill in the blanks using the words given below.



                                                   def, user-defined, built-in, command, return


                       1.   A function may or may not  …………………… a value.
                     2.   The print( ) and input( ) are  …………………… functions.

                     3.   …………………… functions are created by the user according to the need of the program.

                     4.   …………………… keyword begin the function definition.

                     5.    A function can be called anytime from other functions or from the …………………… prompt after
                          the definition.

                 D.  Short answer type questions.
                     1.   What are functions?

                     2.   Write any two features of functions.
                     3.   Write any three advantages of functions.



                                                                                            Functions in Python   55
   52   53   54   55   56   57   58   59   60   61   62