Python Programming - Data Types - Discussion

Discussion Forum : Data Types - General Questions (Q.No. 56)
56.
What is the output of the following code snippet?
my_list = [1, 2, 3, 4, 5]
result = sum(my_list)
print(result)
15
12345
5
Error
Answer: Option
Explanation:
The sum() function calculates the sum of all elements in a list.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.