(n, a, b, K)
return f
Return a polynomial of degree ``n`` with coefficients in ``[a, b]``.

    Examples
    ========

    >>> from sympy.polys.domains import ZZ
    >>> from sympy.polys.densebasic import dup_random

    >>> dup_random(3, -10, 10, ZZ) #doctest: +SKIP
    [-2, -8, 9, -4]
Return a polynomial of degree ``n`` with coefficients in ``[a, b]``.
Return a polynomial of degree n with coefficients in [ a b ] .
def dup_random(n, a, b, K):
    """
    Return a polynomial of degree ``n`` with coefficients in ``[a, b]``.

    Examples
    ========

    >>> from sympy.polys.domains import ZZ
    >>> from sympy.polys.densebasic import dup_random

    >>> dup_random(3, -10, 10, ZZ) #doctest: +SKIP
    [-2, -8, 9, -4]

    """
    f = [ K.convert(random.randint(a, b)) for _ in xrange(0, n + 1) ]

    while not f[0]:
        f[0] = K.convert(random.randint(a, b))

    return f
def dup_random ( n , a , b , K ) : f = [ K . convert ( random . randint ( a , b ) ) for _ in xrange ( 0 , n + 1 ) ] while not f [ 0 ] : f [ 0 ] = K . convert ( random . randint ( a , b ) ) return f