How can I make a function that is given a function as input and returns a function with the value tripled. Here is some pseudo code for what I'm looking for. Concrete examples in Python or Scala would be appreciated.
def f(int x):return x ** 2def tipleFunc(Function g)return 3 * gFunction newFunc = tripleFunc(f)
print newFunc(5)