Python Programming Multiple Choice Question - Functions

This section focuses on the "Functions" of the Python programming. These Multiple Choice Questions (mcq) should be practiced to improve the Python programming skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam and other competitive examinations.

1. Which keyword is use for function?

A. define
B. fun
C. def
D. function

View Answer

2. Which of the following items are present in the function header?

A. function name
B. parameter list
C. return value
D. Both A and B

View Answer

3. What is called when a function is defined inside a class?

A. class
B. funtion
C. method
D. module

View Answer

4. If return statement is not used inside the function, the function will return:

A. None
B. 0
C. Null
D. Arbitary value

View Answer

5. What is a recursive function?

A. A function that calls other function.
B. A function which calls itself.
C. Both A and B
D. None of the above

View Answer

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

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

8. In which part of memory does the system stores the parameter and local variables of funtion call?

A. Heap
B. Stack
C. Uninitialized data segment
D. None of the above

View Answer

Also check :


* You must be logged in to add comment.