next((x for x in random.sample(list(range(minimum, maximum)), maximum - minimum) if
    not [t for t in [2] + list(range(3, int(x ** 0.5) + 1, 2)) if not x % t
    ]), None)
Creating only one random prime number in provided range