Write a function that returns sum of all odd elements in the list
Topic: Write a function that returns sum of all odd elements in the list
Solution
def sum_even_elements(l:list): return sum([i for i in l if i%2==0])
List all Python Programs
Solution
def sum_even_elements(l:list): return sum([i for i in l if i%2==0])