'Returns the last non-zero coefficient of ``f``.
Examples
>>> from sympy import Poly
>>> from sympy.abc import x
>>> Poly(x**3 + 2*x**2 + 3*x, x).EC()
3'

def EC(f, order=None):

    if hasattr(f.rep, 'coeffs'):
        return f.coeffs(order)[(-1)]
    else:
        raise OperationNotSupported(f, 'EC')
