Worksheet on Functions and modules in Python
Worksheet on Functions and modules in Python
Q.1: Which of the function return the smallest integer not less than number .
a) exp()
b) ceil()
c) floor()
d) fabs()
Q.2:Which of the following is not a type of function ?
a) built in function
b) function defined in modules
c) user defined function
d) python function
Q.3 : …………… is a reserved word for defining a function .
a) fun
b) def
c) define
d) pyfun
Q.4:What is the output of math.ceil(89.7)?
a) 90
b) 7
c) 89
d) 80
Q.5:What is the another name of parameters ?
a) formal argument
b) actual argument
c) actual parameters
d) none of these
Q.6: Out of the following ,which function should we use to generate random numbers between 1 and 5 ?
a) random()
b) randint()
c) range()
d) generate()
Q.7:What is the default value of a function that does not return any value ?
a) None
b) int
c) double
d) null
Q.8: A _______ is a file( .py file ) that contains variables , class , statements related to particular task.
a) function
b) module
c) docstring
d) none of these
Q.9:Which of the following is the form of import statement ?
a) import<module name>
b) from <module> import <object>.
c) import py.<module name>
d) all of these
Q.10:The help statement display __________ from a module .
a) constants
b) fuctions
c) classes
d) docstrings
Q.11: A ______ is a named block of statements that can be invoked by its name .
Q.12: The ______ function returns the largest integer not greater than number.
Q.13:The ______ module of python provides random number generation functionality .
Q.14:How are the following two statements differ from one another ?
a) Import maths
b) From maths import*
Q.15 :What is the utility of random module ?
Q.16 :What is the significance of modules?
Q.17: What is the role of an argument of a function?
Solution for Worksheet on Functions and modules in Python