Using list comprehension creates an expression that sums up all the factors of a number that you input. (Hint: If you input 6, it should print 12 (i.e., 1 + 2 + 3 + 6 = 12).)
Given a list of integers L, use list comprehension to:
(a) Find the sum of the even integers in list L
(b) Find the sum of the odd integers in list L.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here