Autumn Offers - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Practice

Instruction

Great! How about this one?

Exercise

Create a function named is_triangle_possible() that accepts three positive numbers. It should return True when it is possible to create a triangle from the line segments of given lengths and False otherwise.

With 3 numbers, it is sometimes, but not always, possible to create a triangle:

You can't create a triangle from a = 13, b = 2 and c = 3.

triangle

But you can build a triangle from a = 13, b = 9 and c = 10.

triangle

Stuck? Here's a hint!

You need to make sure that three conditions hold at the same time:

a < b + c
b < a + c
c < a + b