Class 12 Questions : Function Set 2

1.
What is the output of the following piece of code?

def find(a, **b):
   print(type(b))

find('letters',A='1',B='2')

a)String
b)Tuple
c)Dictionary
d)An exception is thrown

2.
What is the output of the following code?

def abc(k):
    k[0] = 1
q = [0]
abc(q)
print(q)

a) [0]
b) [1]
c) [1, 0]
d) [0, 1]

3.
How many keyword arguments can be passed to a function in a single function call?

a) zero
b) one
c) zero or more
d) one or more

4.
What is the output of the following code?

def xyz(fname, val):
    print(fname(val))
xyz(max, [1, 2, 3])
xyz(min, [1, 2, 3])

a) 3
1
b) 1
3
c) error
d) none of the mentioned

5.
What is the output of the following code?

def fun():
    return total + 1
total = 0
print(fun())

a) 0
b) 1
c) error
d) none of the mentioned