You are viewing a single comment's thread. Return to all comments →
It is not necessary.
If a == b, and b == c, that implies that a == c, by Transitive Property of Equality
You are right.
That's why there is no a==c part in the first if-clause.
Here we, however, are talking about the second elif-clause, ISOSCELES, and now, omitting a==c part makes it buggy.
if a==b and b==c is true and if a==c also happens to be true wouldn't that make it an equilateral triangle ?!
I would prefer to condition with Equilateral and Scalene triangles and rest of the conditions would lead to Isosceles by default ....