Python - MCQ
Multiple Choice Questions
Python - Multiple Choice Questions (MCQ) - Python functions, Modules and Packages - Set 20
6. Which of the following is the use of id() function in python?
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
View Answer
Correct: B
7. Which of the following function headers is correct?
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)
View Answer
Correct: C
8. In which part of memory does the system store the parameter and local variables of a function call?
A). heap
B). stack
C). Uninitialized data segment
D). None of the above
View Answer
Correct: B
9. How is a function declared in Python?
A). def function function_name():
B). declare function function_name():
C). def function_name():
D). declare function_name():
View Answer
Correct: C
10. Which one of the following is the correct way of calling a function?
A). function_name()
B). call function_name()
C). ret function_name()
D). function function_name()
View Answer
Correct: A