(left, right)
Generate a prime over (left, right]
        :param left:
        :param right:
        :return:
Generate a prime over (left, right]
        :param left:
        :param right:
        :return:
Generate a prime over ( left right ] : param left : : param right : : return :
def generate_prime(left, right):
        """
        Generate a prime over (left, right]
        :param left:
        :param right:
        :return:
        """
        while True:
            random_integer = random.randint(left, right)
            random_prime = next_prime(random_integer)
            if random_prime <= right:
                return random_prime
def generate_prime ( left , right ) : while True : random_integer = random . randint ( left , right ) random_prime = next_prime ( random_integer ) if random_prime <= right : return random_prime