Page 228 - Computer Science V2.0 Class 11
P. 228

4.  What value does max(4,   20,   -20,   -35,   -4,   35) yield?
                    a.  35                   b. -35                 c. 4                  d. -4
                 5.  What will be the output produced on evaluating the following expression?
                    divmod(39,  5)
                    a. (4,  7)               b. (7,   4)            c. (7.0,   4.0)       d. (4.0,  7.0)
                 6.  What will be the output produced on evaluating the following expression?
                    int(123.987)
                    a. 123                   b. 123.0               c. 124                d. 124.0
                 7.  Which of the following functions is used to display the description of a user-defined function?
                    a. desc()                b. DESCRIBE()          c. help()             d. HELP()
                 8.  Which of the following statements is incorrect?
                    a.  A function may have no argument and no return value
                    b.  A function must have at least one argument
                    c.  A function may have argument(s) but no return value
                    d.  A function may have argument(s) as well as the return value

                 9.  What will be the output produced on evaluating the following expression?
                    eval(50+75)
                    a.  125                  b. '50+75'             c. Error              d. No Output
              B.  State whether the following statements are True or False:
                 1.  Multiple functions can be integrated to solve a complex problem.                        __________
                 2.  The rules for naming a function are not the same as those for naming an identifier.       __________
                 3.  The sequence of statements included in a function's body is executed when the function is defined.    __________
                 4.  A function must be defined before it is called.                                         __________

              C.  Fill in the blanks.
                 1.  A _________ is a sub-program that manipulates data received as input arguments to solve a problem.
                 2.  A function is invoked using the ______________ followed by the sequence of arguments in parenthesis.
                 3.  When a function is called, the control shifts to the ________statement of the function body.
                 4.  The first line of the function definition is known as ____________.
                 5.  ____________ are the input values given to a function.
              D.  Answer the following questions:
                 1.  What is the advantage of using functions in a program?
                 2.  What is a function header? What information does it contain?
                 3.  Differentiate between the following:
                     a. Parameters and Arguments
                     b. Function definition and Function Call
                 4.  Can a function return multiple values?
                 5.  Write a function that takes one number as an argument and returns the square of that number. Also give the function call
                    for the same.
                 6.  What will be the output produced on execution of each of the following:
                     a. >>> print('Python is \n easy to learn')
                     b. >>> print('You have  \t an exam tomorrow')
                 7.  What will be the output produced on execution of the following code snippet:

                    print('BIG', 'BIGGER', 'BIGGEST', sep = '*')
                    print('Jim', 'Jam', 'Jin', end='##')
                    print('First', 'Sem', 'End', sep='-',  end = '#Festival#')
               214   Touchpad Computer Science (Ver. 2.0)-XI
   223   224   225   226   227   228   229   230   231   232   233