Probability that Three Pieces Form a Triangle
Direct boolean return

As @Grajdeanu Alex says, this:

if (ab &gt; c and ac &gt; b and bc &gt; a):
    return True

return False


can simply be

return ab &gt; c and ac &gt; b and bc &gt; a


Type hints

def can_form_triangle(a, b, c):


can be

def can_form_triangle(a: float, b: float, c: float) -&gt; bool:


Sort unpack

first_point = random()
second_point = random()
sorted_points = sorted((first_point, second_point))

return can_form_triangle(sorted_points[0], sorted_points[1] - sorted_points[0], 1 - sorted_points[1])


can be

    first_point, second_point = sorted((random(), random()))

    return can_form_triangle(first_point, second_point - first_point, 1 - second_point)


Digit triples

10000000 is more easily read as 10_000_000.

Attempt looping

num_attempts will evaluate to 10_000_000 so it's not worth tracking unless you add an early-exit mechanism.

The whole loop can be replaced with

num_success = sum(
    1
    for _ in range(10_000_000)
    if try_one_triangle()
)


Redundant parentheses

print('Ratio:', num_success / (num_attempts))


does not need the inner parens.