Question
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
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?
Similar Questions
Discover Related MCQs
Q. Python supports the creation of anonymous functions at runtime, using a construct called __________
View solution
Q. Does Lambda contains return statements?
View solution
Q. What is a variable defined outside a function referred to as?
View solution
Q. What is a variable defined inside a function referred to as?
View solution
Q. If a function doesn’t have a return statement, which of the following does the function return?
View solution
Q. If b is a dictionary, what does any(b) do?
View solution
Q. The function complex(‘2-3j’) is valid but the function complex(‘2 – 3j’) is invalid. State whether this statement is true or false.
View solution
Q. Which of the following functions does not necessarily accept only iterables as arguments?
View solution
Q. Which of the following functions will not result in an error when no arguments are passed to it?
View solution
Q. Which of the following functions does not throw an error?
View solution
Q. Which of the following is a features of DocString?
View solution
Q. Lambda is a statement.
View solution
Q. Lambda contains block of statements.
View solution
Suggested Topics
Are you eager to expand your knowledge beyond Python? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!
Software Engineering
Learn about the systematic approach to developing software with our Software...
Java Programming
Level up your coding skills with our Java Programming MCQs. From object-oriented...
Cyber Security
Understand the fundamentals of safeguarding digital assets with our Cyber Security...