def random_complex_number(a=2, b=(-1), c=3, d=1, rational=False):
 (A, B) = (uniform(a, c), uniform(b, d))
 if (not rational):
  return (A + (I * B))
 return (nsimplify(A, rational=True) + (I * nsimplify(B, rational=True)))

def random_complex_number ( a = 2 , b = ( - 1 ) , c = 3 , d = 1 , rational = False ) : ( A , B ) = ( uniform ( a , c ) , uniform ( b , d ) ) if ( not rational ) : return ( A + ( I * B ) ) return ( nsimplify ( A , rational = True ) + ( I * nsimplify ( B , rational = True ) ) )
return a random complex number .