#C12888. Sum of Integers in Mixed List
Sum of Integers in Mixed List
Sum of Integers in Mixed List
You are given a list containing mixed types of elements including integers, strings, and floats. Your task is to calculate the sum of all the integer elements in the list.
The input is provided as a single line which represents a Python list literal. The list may contain negative numbers or be empty. Only the elements that are valid integers should be summed.
Note: The floats and strings are to be ignored in the summation. In cases where there are no integers, the result should be 0.
Use the specified input and output format to implement the solution.
inputFormat
A single line containing a Python list literal. For example: [1, 'hello', 3.5, 7, 12, 'world', 2, 10.2, 'python', 5]
outputFormat
A single line containing the sum of all integer elements in the list.## sample
[1, 2, 3, 4]
10