Page 102 - Digicode_AI_class_8
P. 102

REFRESH

                   A function is a block of organised and reusable code used to perform a single or related action.
                  Python functions can be categorised into built-in functions and user-defined functions.

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






                                             TeCh Ready





            A.  Tick ( ) the correct option.
                1.  Which of the following is a block of code to perform a particular task?

                    (i)  Function                                    (ii)  Operator

                   (iii)  Parameter                                  (iv)  Argument

                2.  Which of the following are the features of functions?
                    (i)   A program is divided into small modules and each module performs some
                        specific task. Each module can be called as per the requirement.

                    (ii)  We can call a function as many times as require(iv)

                   (iii)   It makes debugging easy and makes the code efficient, both in terms
                        of time and memory.

                   (iv)  All of these

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

                    (i)  Name of the function                        (ii)  Arguments

                   (iii)  Return Value                               (iv)  All of these

                4.  Which of the following is an example of built-In functions?
                    (i)  print( )                                    (ii)  input( )


                   (iii)  Both (i) and (ii)                          (iv)  None of these

                5.   Which of the following contains Python statement and makes function to perform the
                   required task?

                    (i)  Naming a Function                           (ii)  Parameters

                   (iii)  Body of the function                       (iv)  None of these









                100    DigiCode AI-VIII
   97   98   99   100   101   102   103   104   105   106   107