Write a Python program to get numbers divisible by fifteen from a list using an anonymous function.

Write a Python program to get numbers divisible by fifteen from a list using an anonymous function.

1
2
3
4
num_list = [45, 55, 60, 37, 100, 105, 220]
# use anonymous function to filter
result = list(filter(lambda x: (x % 15 == 0), num_list))
print("Numbers divisible by 15 are",result)

Final output

Leave a Comment