Unit 4: Python functions, Modules
and Packages [ MSBTE 22616
Python ]
Total points 30/30
Stay Tuned for Daily Quizzes on All 6th Semester Computer Group Subjects like
PHP, Python, MAD, and other
Online Quiz to help you in preparing for Online Exams, It covers Multiple Choice
Questions (MCQs) for 20 or 20+ Marks
imp Links:
All Theory tutorials: https://bit.ly/335XFKi
contact us on [email protected]
1. Which keyword is used for function? * 1/1
A. define
B. fun
C. def
D. function
2. Which of the following items are present in the function 1/1
header? *
A. function name
B. parameter list
C. return value
D. Both A and B
https://docs.google.com/forms/d/e/1FAIpQLSdlfcKZDj7Zrft-wLUUTwW-Gfh7VBsuAqinXFBLjugfNxzqcg/viewscore?viewscore=AE0… 1/11
3. What is called when a function is defined inside a class? * 1/1
A. class
B. function
C. method
D. module
4. If the return statement is not used inside the function, the 1/1
function will return: *
A. None
B. 0
C. Null
D. Arbitary value
5. What is a recursive function? * 1/1
A. A function that calls other function.
B. A function which calls itself.
C. Both A and B
D. None of the above
https://docs.google.com/forms/d/e/1FAIpQLSdlfcKZDj7Zrft-wLUUTwW-Gfh7VBsuAqinXFBLjugfNxzqcg/viewscore?viewscore=AE0… 2/11
6. Which of the following is the use of id() function in python? * 1/1
A. Id() returns the size of object.
B. Id() returns the identity of the object.
C. Both A and B
D. None of the above
7. Which of the following function headers is correct? * 1/1
A. def fun(a = 2, b = 3, c)
B. def fun(a = 2, b, c = 3)
C. def fun(a, b = 2, c = 3)
D. def fun(a, b, c = 3, d)
8. In which part of memory does the system store the 1/1
parameter and local variables of a function call? *
A. heap
B. stack
C. Uninitialized data segment
D. None of the above
https://docs.google.com/forms/d/e/1FAIpQLSdlfcKZDj7Zrft-wLUUTwW-Gfh7VBsuAqinXFBLjugfNxzqcg/viewscore?viewscore=AE0… 3/11
9. How is a function declared in Python? * 1/1
A. def function function_name():
B. declare function function_name():
C. def function_name():
D. declare function_name():
10. Which one of the following is the correct way of calling a 1/1
function? *
A. function_name()
B. call function_name()
C. ret function_name()
D. function function_name()
11. Which of the following functions is a built-in function in 1/1
python? *
A. array()
B. sqrt()
C. factorial()
D. print()
https://docs.google.com/forms/d/e/1FAIpQLSdlfcKZDj7Zrft-wLUUTwW-Gfh7VBsuAqinXFBLjugfNxzqcg/viewscore?viewscore=AE0… 4/11
12. What will be the output of the following Python expression? 1/1
round(4.576) *
A. 4.5
B. 5
C. 4
D. 4.6
13. What will be the output of the following Python function? 1/1
all([2,4,0,6]) *
A. Error
B. True
C. False
D. 0
14. What will be the output of the following Python expression? 1/1
round(4.5676,2) *
A. 4.5
B. 4.6
C. 4.57
D. 4.56
https://docs.google.com/forms/d/e/1FAIpQLSdlfcKZDj7Zrft-wLUUTwW-Gfh7VBsuAqinXFBLjugfNxzqcg/viewscore?viewscore=AE0… 5/11
15. What will be the output of the following Python function? 1/1
any([2>8, 4>2, 1>2]) *
A. Error
B. True
C. False
D. 4>2
16. What will be the output of the following Python function? 1/1
min(max(False,-3,-4), 2,7) *
A. 2
B. False
C. -3
D. -4
17. A Python module is a file with the _____ file extension that 1/1
contains valid Python code. *
A. .pym
B. .pymodule
C. .module
D. .py
https://docs.google.com/forms/d/e/1FAIpQLSdlfcKZDj7Zrft-wLUUTwW-Gfh7VBsuAqinXFBLjugfNxzqcg/viewscore?viewscore=AE0… 6/11
18. To use a module in another module, you must import it 1/1
using an ________ statement *
A. import
B. include
C. both A and B
D. none of the above
19. A package is a folder containing one or more Python 1/1
modules. One of the modules in a package must be called
_______. *
A. __package__.py
B. __main__.py
C. main.py
D. init.py
E. __init__.py
20. Which statement is correct to import all modules from the 1/1
package *
A. from package import all
B. from package import *
C. from package include all
D. from package include *
https://docs.google.com/forms/d/e/1FAIpQLSdlfcKZDj7Zrft-wLUUTwW-Gfh7VBsuAqinXFBLjugfNxzqcg/viewscore?viewscore=AE0… 7/11
21. What is returned by math.ceil(3.4)? * 1/1
A. 3
B. 4
C. 4.0
D. 3.0
22. What is returned by math.factorial(5)? * 1/1
A. 110
B. 120
C. 100
D. 140
23. What is returned by operator.eq(1,1.0)? * 1/1
A. Equal
B. True
C. False
D. 1
https://docs.google.com/forms/d/e/1FAIpQLSdlfcKZDj7Zrft-wLUUTwW-Gfh7VBsuAqinXFBLjugfNxzqcg/viewscore?viewscore=AE0… 8/11
24. What will be the output of * 1/1
A. error
B. No output
C. 40
D. 0
25. Which function is called an anonymous function? * 1/1
A. Lambda
B. map
C. filter
D. reduce
26. What will be the output of * 1/1
A. array
B. numpy array
C. python array
D. list
https://docs.google.com/forms/d/e/1FAIpQLSdlfcKZDj7Zrft-wLUUTwW-Gfh7VBsuAqinXFBLjugfNxzqcg/viewscore?viewscore=AE0… 9/11
27. Select correct python packages from following * 2/2
numpy
opencv
math
matplotlib
SciPy
tensorflow
decimal
28. What will be the of * 2/2
A. 0
B. 11
C. 22
D. Error
Feedback (cwipedia.in)
This content is neither created nor endorsed by Google. - Terms of Service - Privacy Policy
Forms
https://docs.google.com/forms/d/e/1FAIpQLSdlfcKZDj7Zrft-wLUUTwW-Gfh7VBsuAqinXFBLjugfNxzqcg/viewscore?viewscore=AE… 10/11
https://docs.google.com/forms/d/e/1FAIpQLSdlfcKZDj7Zrft-wLUUTwW-Gfh7VBsuAqinXFBLjugfNxzqcg/viewscore?viewscore=AE… 11/11