Write a program to Find Numbers Divisible by Another Number in Python
Code:
1 2 3 4 5 6 7 8 9 10 11 12 |
# Python Program to find numbers divisible by fifteen from a list using anonymous function # Take a list of numbers my_list = [300, 45, 65, 12, 77, 145, 5,] # use anonymous function to filter result = list(filter(lambda x: (x % 15 == 0), my_list)) # display the result print("Numbers divisible by 13 are",result) |