Python Programming - Functions - Discussion
Discussion Forum : Functions - General Questions (Q.No. 33)
33.
What will be the output of the following code snippet?
def add(a, b):
return a + b
numbers = [1, 2, 3, 4]
result = add(*numbers)
print(result)
Answer: Option
Explanation:
The
*numbers
syntax unpacks the list, and the function add
adds all elements together.
Discussion:
Be the first person to comment on this question !
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers