Vidyalelo
Python · Q18

Functions in Python

Programming · Python · question 18

Q18

What will be the output of the following Python code? 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
Answer
B.
6
100
C.
123
12345
D.
None of the mentioned

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board