A
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))
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 - Option(B)
- Views: 30
- Filed under category Python
- Hashtags:
Discusssion
Login to discuss.