Skip to content

Instantly share code, notes, and snippets.

@js947
Last active August 29, 2015 14:02
Show Gist options
  • Save js947/037ef69ea365736d3e44 to your computer and use it in GitHub Desktop.
Save js947/037ef69ea365736d3e44 to your computer and use it in GitHub Desktop.
import operator
def frk(a, r, b):
return lambda x: r(a(x), b(x))
avg = frk(sum, operator.div, len)
ans = avg([1.0, 2.0, 3.0, 4.0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment