#!/usr/local/bin/python2 def a(x): return x + 2 def b(x): return x * 3 def c(x): return x - 4 t = (a, b, c) for i in xrange(100000): reduce(lambda x, y: y(x), t, 1)