def dup_random(n, a, b, K):
 f = [K.convert(random.randint(a, b)) for _ in range(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 range ( 0 , ( n + 1 ) ) ] while ( not f [ 0 ] ) : f [ 0 ] = K . convert ( random . randint ( a , b ) ) return f
return a polynomial of degree n with coefficients in [a .