# Class 12 Computer Science Python Functions – Working with Functions MCQs Set – 3

### Python Functions – Working with Functions MCQ’s

Multiple Choice Questions [MCQs] Set – 3

41. When the function call statement must match the number and order of arguments as defined in the function definition, this is called the ___________ matching.

a) Positional Arguments

b) Default Arguments

c) Keyword Arguments

d) None of these

42. Which of the following statement is not true in respect to Postitional/Required arguments function call statement?

a) the arguments must be provided for all parameters.

b) the type of the argument must be matched.

c) the values of arguments are matched with parameters, position wise.

d) None of these

Answer : b) the type of the argument must be matched. [ In Python, data type of variable depend upon the value only, it is not defined in advance]

43. Positional arguments are also know as mandatory arguments.

a) True

b) False

44. Which of the following statements are true for Mandatory / Required / Positional arguments?

a) No values can be skipped from function call.

b) Order of arguments cannot be change in function call.

c) cannot assign value of first argument to third parameter.

d) All of these

Answer : d) All of these

ci = p * ( 1 + r/100)**t – p

45. Which of the following function call statement is Invalid?

``````def compoundInterest(p, r, t):
ci = p * ( 1 + r/100)**t - p
return ci
``````

a) interest = compoundInterest(100, rate, 5)

b) interest = compoundInterest(prin, rate, time)

c) interest = compoundInterest(500, 10)

d) None of these

Answer : c) interest = compoundInterest(500, 10)

46. In Python, can you assign a default value to the parameter?

a) Yes

b) No

47. A ________ is a value that is pre-decided and assigned to the parameter when the function call does not have its corresponding argument.

a) no value

b) value

c) default value

d) All of these

48. The default value is specified in a manner syntactically similar to a ________.

a) required arguments

b) variable initialization

c) function definition

d) None of these

49. A parameter having default value in the function header is known as a ________.

a) formal parameter

b) actual parameter

c) default parameter

d) None of these

50. ________ arguments cannot follow default argument.

a) Non-default

b) Default

c) Actual argument

d) None of these

51. A parameter having a default value in function header becomes ________ in function call.

a) mandatory

b) required

c) optional

d) None of these

52. Default values are considered only when _________ .

a) no value is provided for that parameter in function call.

b) function is not called.

c) function is called with all parameters.

d) None of these

Answer : a) no value is provided for that parameter in function call.

53. In the given code, which argument has default value.

``````def compoundInterest(principal, rate, time = 5):
ci = p * ( 1 + r/100)**t - p
return ci``````

a) principal

b) rate

c) time

d) None of these

54. On the basis of the given code, Identify which of the function call statement is invalid?

``````def compoundInterest(principal, rate, time = 5):
ci = p * ( 1 + r/100)**t - p
return ci``````

a) t = compoundInterest(5000, 10, 15)

b) t = compoundInterest(5000, 15)

c) t = compoundInterest(5000)

d) None of these

Answer : c) t = compoundInterest(5000)

55. Why the given function definition is not valid?.

``````def compoundInterest(principal, rate = 10, time):
ci = p * ( 1 + r/100)**t - p
return ci``````

a) because non-default arguments follow the default argument.

b) because the value of variable rate is not valid.

c) because the use of return statement is invalid.

d) None of these

56. Identify the valid function header?

a) def sum( p=5, q, r = 15) :

b) def sum(p, q = 10, r) :

c) def sum(p = 5, q, r ) :

d) def sum(p = 5, q = 10, r = 15) :

Answer : d) def sum(p = 5, q = 10, r = 15) :

57. Identify the valid function header?

a) def sum( p=5, q, r = 15) :

b) def sum(p, q = 10, r) :

c) def sum(p , q, r = 15 ) :

d) def sum(p = 5, q = 10, r ) :

Answer : c) def sum(p , q , r = 15) :

58. Find the output of given code:

``````def func(x , y = 5, z = 10):
x = y + z
return x + z

print( func(10), func(10, 15), func(10, 15, 25))``````

a) 15 25 35

b) 25 35 65

c) 35 65 85

d) None of these

Answer : b) 25 35 65

59. ________ type of function call provide you facility to write any argument in any order.

a) Default argument

b) Keyword argument

c) Required argument

d) None of these

60. Which of the following function header is the Keyword (named) arguments function?

a) def sum( x, y, z) :

b) def sum( x, y , z = 20) :

c) def sum( x = 20, y = 10, z = 5) :

d) None of these

Answer : c) def sum( x = 20, y = 10, z = 5):