Skip to content

Instantly share code, notes, and snippets.

@ilhamije
Created April 26, 2020 03:27
Show Gist options
  • Save ilhamije/b643e6575bf5802a1fca8a5068af6ad0 to your computer and use it in GitHub Desktop.
Save ilhamije/b643e6575bf5802a1fca8a5068af6ad0 to your computer and use it in GitHub Desktop.
JDS-ilham-DE-Python-2
from functools import reduce
pipeline = [lambda x: x * 3, lambda x: x + 1, lambda x: x / 2]
val = reduce(lambda x, f: f(x), pipeline, 3)
print(val)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment