Q. What is the output of the following code?
Code:
def add(init = 5, *nbr, **key):
c = init
for n in nbr:
c+=n
for k in key:
c+=key[k]
return c
print(add(100,2,2, x=20, y=10))
β
Correct Answer: (B)
134
Explanation: The function adds 2, 2, 20 and 10 to the initial value 100, so the result is 134