Lambda Odd
def is_odd(digit):
if digit % 2 != 0:
return True
return False
digits = [
1, 7, 18, 2, 4, 2, 8, 5, 3
]
digits
[1, 7, 18, 2, 4, 2, 8, 5, 3]
new_list = list(filter(lambda x: is_odd(x) , digits))
new_list
[1, 7, 5, 3]