> > functional programming: > > # with an internal named function > def fsquare(f): > def f2(x): > return f(x)**2 > return f2 > this seems to be the most pythonic (lambda is not the preferred approach usually). Of course someone will mention taking this to the next step with a compose() function which take f(x) and g(x).