Home / MCQ Bank / Computer
Computer Functions In Python

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)

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option A • 6 15

Related Computer Questions

What will be the output of of the following SQL statement? SELECT person_id, Fname, lname FROM person; Which of the following toolbars provide different options in various master views? Which is the element that follows the use of “img”? The Crunch APIs are modeled after ______ which is the library that Google uses for building data pipelines on top of their own implementation of MapReduce. What will be the output of the following C++ code? #include <iostream> using namespace std; int main () { int a; int * ptr_b; int ** ptr_c; a = 1; ptr_b = &a; ptr_c = &ptr_b; cout << a << "\n"; cout << *ptr_b << "\n"; cout << *ptr_c << "\n"; cout << **ptr_c << "\n"; return 0; }