I'm still new to python and I was wondering if there was a way to simplify this function into something close to a one-liner:
filters = [lambda x: is_big(x), lambda x: is_wide(x), lambda x: is_gray(x)]
def filter(input):
for func in filters:
if(not func(input)):
return False
else:
continue
return True
Assume the functions in the filters list return booleans. Basically is there any way I can do something like all(apply input to each filter)
?