The following code does not compile.
data = [5, 3, 2, 4, 1]
def projector(x):
if (x % 2) == 0:
return 1
else:
return 0
# evens = map(projector, data)
evens = map(lambda x: if (x % 2) == 0: 1 else: 0, data)
print(list(evens))
Question
What is the correct lambda that is equivalent to projector
above?