Functions
1.

 Which keyword is use for function?

A.  

define

B.  

fun

C.  

def

D.  

function

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

3.

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

A.  

class

B.  

function

C.  

method

D.  

module

4.

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

A.  

None

B.  

0

C.  

Null

D.  

Arbitary value

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

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

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)

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

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():
 

 

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()