What is the output of print(sum([1, 2, 3])) in Python?
print(sum([1, 2, 3]))
Correct answer
C. 6
5 views
C. 6
5 views
sum() adds all items of an iterable.
Asked in: Python Interview Lists
https://docs.python.org/3/tutorial/datastructures.htmlNot sure why the answer is C? Ask here and get an explanation.