<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def cond(A):
 """Return condition number of A. Parameters A : {dense or sparse matrix} Returns ------- 2-norm condition number through use of the SVD Use for small to moderate sized dense matrices. For large sparse matrices, use condest. Notes ----- The condition number measures how large of a change in the problems solution is caused by a change in problem's input. Large condition numbers indicate that small perturbations and numerical errors are magnified greatly when solving the system. Examples -------- 2.0 """

    if A.shape[0] != A.shape[1]:
        raise ValueError('expected square matrix')

    if sparse.isspmatrix(A):
        A = A.todense()

    # 2-Norm Condition Number
    from scipy.linalg import svd

    U, Sigma, Vh = svd(A)
    return np.max(Sigma)/min(Sigma)