Python Programming Multiple Choice Question - Functions

This section focuses on "Functions" of the Python programming. These python Mcq questions 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. function
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


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


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







Also check :


Discussion


* You must be logged in to add comment.