Divisibility Filter Function

  • Share this:

Code introduction


This function takes two arguments, a and b, and returns a list containing all elements of a that are divisible by b.


Technology Stack : List comprehension

Code Type : List deduction

Code Difficulty : Intermediate


                
                    
def aaaa(a, b):
    return [x for x in a if x % b == 0]