Skip to content

Instantly share code, notes, and snippets.

@Risyandi
Last active January 9, 2020 14:20
Show Gist options
  • Save Risyandi/6a7812f89d504e968a529de633a41b0c to your computer and use it in GitHub Desktop.
Save Risyandi/6a7812f89d504e968a529de633a41b0c to your computer and use it in GitHub Desktop.
Jawaban soal data engineer Jabar Digital Services
def pipeline(*funcs):
def helper(arg):
for func in funcs:
arg = func(arg)
return arg
return helper
fun = pipeline(lambda x: x * 3, lambda x: x + 1, lambda x: x / 2)
print(fun(3)) #should print 5.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment