Q. Output of the following python program will be?
Code:
List = [True, 50, 10]
List.insert(2, 5)
print(List, "Sum is: ", sum(List))
-
(A)
[True, 50, 10, 5] Sum is: 66
-
(B)
[True, 50, 5, 10] Sum is: 65
-
(C)
TypeError: unsupported operand type(s) for +: ‘int’ and ‘str’
-
(D)
[True, 50, 5, 10] Sum is: 66
✅ Correct Answer: (D)
[True, 50, 5, 10] Sum is: 66