Write a function to adds two lists element wise only if numbers are even


Topic: Write a function to adds two lists element wise only if numbers are even

Solution

def adds_listevenelements(l1:list, l2:list):
    return [i+j for i, j in zip(l1,l2) if i*j%2 == 0]



List all Python Programs