निम्नलिखित का आउटपुट क्या होगा?
What will be the output of the following ?
print(sum(1,2,3))
A)
B)
C)
D)
Explanation:
The output is (A) Error because the sum()
function expects an iterable (like a list or tuple) as its first argument. You passed separate numbers instead of an iterable.
Correct usage:
print(sum([1, 2, 3])) # This would return 6