def extreme(t, test): m = t[0] for x in t: if test(x,m): m = x return m