I'm new to this stuff...Need some python help :$ function: def sum_even_lol (lol) ~> The input parameter to this function is a list of “little-lists” (lol) (with at least one little list), where all the “little-lists” have the same number of elements (with at least one element), and those elements are positive integer numbers. As well, there are as many little lists as elements in each little list. (One can visualize this type of list of lists as a square matrix). The function should return the sum of all the numbers in the matrix that are even.If there are no even numbers the function should return the number 0. ex. sum_even_lol([[1,2,3],[6,5,4],[5,7,9]]) should return 12
You could write a helper function that goes through a list and checks the numbers for eveness, adds appropriately, and returns the total. sum_even_lol can iterate through the outer list and call the helper with a list and add it's return value to a total.
You can also show us how far you got so that we can point out issues or what you could try next.
Nevermind i figured it out thanks :)
Kk. But for future reference, help here goes a lot quicker if you show what you have tried so far and have a more specific issue to deal with.
Join our real-time social learning platform and learn together with your friends!