Boolean31. Given integers a, b, c, which are the sides of some triangle. Check the truth of the statement: "A triangle with sides a, b, c is isosceles".

Solution in Python 3:

import random

def TriangleInequality(A,B,C):
return (A < B+C) and (B < A+C) and (C < A+B)

a,b,c = [random.randrange(1, 6) for i in range(0,3)]
while not TriangleInequality(a,b,c):
a,b,c = [random.randrange(1, 6) for i in range(0,3)]

print("Length a: ", a)
print("Length b: ", b)
print("Length c: ", c)

bool_expr = (a == b or a == c or b == c)
print("The triangle is isosceles: ",bool_expr)