Page 291 - Computer Science Class 11 With Functions
P. 291

4.  All non-default parameters (if any) should precede the default parameters.             __________
               5.  The following is an example of a correctly formed function header:

                 def test(num1=10, num2):                                                                 __________
            C.  Fill in the blanks.
               1.  Python module _____is a useful module that enables us to generate random numbers.
               2.  Functions ceil and floor are available in ______ module of Python.
               3.  Input arguments specified in a function in an arbitrary order by explicitly associating the names of the formal parameters
                  with their values are known as __________.
               4.  A _________ value is used only if the corresponding parameter is not given during the function call.
               5.  Python module ________ enables us to compute statistical quantities like mean, median, and mode.
            D.  Answer the following questions:
               1.  Consider the code given below:
                 import math
                 def practice(num):
                     sq = math.sqrt(num)
                     print('Square Root is ', sq)
                 p=49
                 practice(p)
                  Identify the following:
                  a.  Name of user defined function
                  b.  Function header
                  c.  Name of built-in function used to find square root
                  d.  Argument(s)
                  e.  Formal parameter(s)
                  f.  Function Body
                  g.  Function Call Statement
             Ans.  Name of user-defined function : practice
                  Function header : def practice(num):
                  Name of built-in function used to find square root : sqrt()
                  Argument(s): p
                  Formal parameter(s) : num
                  Function Body:
                  sq=math.sqrt(num)
                  print('Square Root is ',sq)
                  Function Call Statement: practice(p)
               2.  Identify the function call for determining the following:
                  a.  An odd random integer from the first 100 natural numbers.
                  b.  Value of pi upto 2 decimal places.
                  c.  Log value of 100 to the base 2.
                  d.  Log value of 100 to the base 10.
                  e.  Log value of 100 to the base e.
                  f.  Sine value of angle having degree 45.
                  g.  Tangent value of angle having degree 360.
                  h.  Greatest common divisors of 18 and 34.




                                                                                                      Modules    289
   286   287   288   289   290   291   292   293   294   295   296