Computer Science, asked by true23, 25 days ago

Write a program to delete all the odd numbers and negative numbers in a numeric list. for Eg;

if List=[0, -12, 13, 54, -20, 22, 86, 100, -102, 90, -31] then after removing all the odd numbers

and negative numbers the list become:

List=[0, 54, 22, 86, 100, 90]​

Answers

Answered by themrmindless
2

Answer:

def remove_odd(l):

return [e for e in l if e % 2 == 0]

remove_odd([0, -12, 13, 54, -20, 22, 86, 100, -102, 90, -31])

[0, 54, 22, 86, 100, 90]

MARK ME AS BRAINLIEST

Similar questions