adplus-dvertising
frame-decoration

Question

What is the output of the below program?
def sum(*args):
   '''Function returns the sum 
   of all values'''
   r = 0
   for i in args:
      r += i
   return r
print sum.__doc__
print sum(1, 2, 3)
print sum(1, 2, 3, 4, 5)

a.

6
15

b.

6
100

c.

123
12345

d.

None of the mentioned

Posted under Python

Answer: (a).6
15

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of the below program?