Function - Worksheet 1 - 1 Marks
Function - Worksheet 1 - 1 Marks
Function - Worksheet - 1
1 Marks
Which of the following statements should be given in the blank for #Missing Statement,
if the output produced is 110?
a. global a b. global b=100 c. global b d. global a=100
8. Write the output of the following Python code :
def Update(X=10):
X += 15
print('X = ', X)
X=20
Update()
print('X = ', X)
9. Which of the following statement(s) would give an error after executing the following
code?
def prod (int a): #Statement 1
d=a*a #Statement 2
print(d) #Statement 3
return prod #Statement 4
(a) Statement 1 and Statement 2 (c) Statement 1 and Statement 4
(b) Statement 1 and Statement 3 (d) Statement 2 and Statement 4
10. Assertion (A) :- A return statement returns a value as well as the control from a
function.
Reasoning (R) :- It is compulsory for all functions to have a return statement.
11. Assertion(A):-If the arguments in function call statement match the Number and
order of arguments as defined in the function definition, such arguments are called
positional arguments.
Reasoning(R):-During a function call, the argument list positional argument(s) must
occur after the default arguments.