abstract functions in python without using lambda

abstraction, python

Solution

How do you get the intersection of two sets? If you use the `set` data type, you can just use `&` for union:

print list(set(a) & set(b))

Problem

I just have a question. how to use abstract functions without lambda? say I have two list ``` a = [1,2,3,4,5] b = [2,4,6] ``` if I want to print all the elements both appear in A and B, with lambda: ``` def f(): print reduce (list.__add__ , map (lambda x: filter (lambda y: x == y, b), a)) ``` how to do it without lambda? i mean i'm just using helper functions instead of lambda

Original source