In this program, you’ll learn to find the numbers divisible by another number and display it.
To understand this example, you should have the knowledge of the following Python programming topics:
In the program below, we have used anonymous (lambda) function inside the filter()
built-in function to find all the numbers divisible by 13 in the list.
Source Code
# 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:
Python Program to Calculate the Area of a Triangle
Python locals()
Statistical Methods for Machine Learning - Disconver how to Transform data into Knowledge with Pytho...
Python hex()
Python range()
Python Program to Differentiate Between del, remove, and pop on a List
Python Program to Convert Bytes to a String
Python String casefold()
Python round()
Python pow()
Python String isupper()
Python List
Python Set discard()
Python Machine Learning Third Edition - Sebastian Raschka & Vahid Mirjalili
Python Operator Overloading
Python while Loop
Python Artificial Intelligence Project for Beginners - Joshua Eckroth
Python Program to Remove Punctuations From a String
Building Chatbots with Python Using Natural Language Processing and Machine Learning - Sumit Raj
Python Program to Find Armstrong Number in an Interval
Python Functions
Python datetime
Python String split()
Python Program to Compute all the Permutation of the String
Python Program to Find ASCII Value of Character
Python Matrices and NumPy Arrays
Python *args and **kwargs
Python Program to Find HCF or GCD
Python String isalpha()
Python del Statement
Python Program to Reverse a Number
Python Global Keyword