Академический Документы
Профессиональный Документы
Культура Документы
M. Marks: 70
Date: Duration :
Name of the Student: ___________________________________________
Roll No:
_________________________________________________________________________________________
_______________________________
Trace the execution of the code and predict output produced by it.
f) What is the significance of having a function in a program? 2
4. a) Mention any three python libraries that cab ne used in python 3
programming and explain them briefly
b) Identify the module which you’ll need to import in order to use the
following function
i. request.urlopen(<URL>)
ii. randint(a,b)
Or 1
b) What is the difference random() and randint()?
c) Write the syntax to import 3
i. Single Object
ii. Multiple Object
iii. All objects
From a module with relevant examples
d) What is the difference between int() and round() functions, how are they 2
used? Explain with proper syntax and relevant examples
e) What are docstring? What is their significance? Give example to support
your answer.
Or 2
f) What is a package? How is a package different from module?
g) What is the problem in the following code? 1
from math import factorial
print (math.factorial(5))
h) What is the procedure to create own library or package in python? 3
5 a) What is a recursive Function? Write one advantage of recursive functions. 2
b) What is a base case?
Or 1
b) What is a recursive case?
c) Which function is considered slower, recursive or iterative? Explain briefly? 2
d) 2