Can we pass two arguments in the function that returns true and filters a list?
I am trying to get divisor from user and dividend be picked up from the list.
print "Get the divisor"
h=lambda x,divisor: x%divisor==0
Yes, you can, if you have
divisor defined in the surrounding scope.
But then, you will not need to use it as an argument any longer:
divisor = int(raw_input()) ans = filter(lambda x: x % divisor==0, new_list) print ans