Page 103 - Digicode_AI_class_8
P. 103

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

            C.  State whether these statements are true or 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 are referred to as argument.
                5.  A function can or cannot have any parameters.

            D.  Answer the following questions:
                1.  What are functions?


                2.  Write any two features of functions.



                3.  Write any three advantages of functions.


                4.  Write the components of a function.




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



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




                7.  What are the different ways to create a function? Explain in detail.





                                                                                    Functions in Python  101
   98   99   100   101   102   103   104   105   106   107   108