;

Python Program to Find Numbers Divisible by Another Number


Tutorialsrack 22/04/2020 Python

In this Python Program, we will learn how to find the number from the python list which is divisible by the other given number.

Here is the code of the program to find the number from the python list which is divisible by the other given number.

Python Program to Find Numbers Divisible by Another Number
# Python Program to Find Numbers Divisible by Another Number

# Take a list of numbers
my_list = [12, 65, 54, 39, 102, 339, 221]

# use anonymous function to filter
result = list(filter(lambda x: (x % 13 == 0), my_list))

# display the result
print("Numbers divisible by 13 are",result)
Output

Numbers divisible by 13 are [65, 39, 221]


Related Posts



Comments

Recent Posts
Tags