Example:
print max(chain_length(i) for i in xrange(1,10001))
This returns the maximum/biggest "chain_length" (an arbitrary function), but what I want is the i value for input that produces the biggest value.
Is there a convenient way to do that?