Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

10
  • 2
    shouldn't your list be in reverse? Commented May 21, 2013 at 10:46
  • 1
    y(x) is not a function composition. I think it should be reduce(lambda f, g: lambda *args: f(g(*args)), [a, b, c, d, e]). Commented May 21, 2013 at 10:58
  • 1
    @nymk x is the previous (partial) value, y is the current function to be applied... Commented May 21, 2013 at 11:06
  • 1
    @fortran You're right. Then it should be reduce(lambda x, y: y(x), [e, d, c, b, a], initial_value). Furthermore, in this method, e must take exactly one argument. Commented May 21, 2013 at 11:19
  • 1
    @HennyH The question implied that wasn't a requirement Commented May 21, 2013 at 11:38