From 62c0e36c3e88a58802fa6678c6d06a847dc75abd Mon Sep 17 00:00:00 2001 From: "exercism-solutions-syncer[bot]" <211797793+exercism-solutions-syncer[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 11:57:07 +0000 Subject: [PATCH] [Sync Iteration] python/triangle/3 --- solutions/python/triangle/3/triangle.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 solutions/python/triangle/3/triangle.py diff --git a/solutions/python/triangle/3/triangle.py b/solutions/python/triangle/3/triangle.py new file mode 100644 index 0000000..84c666b --- /dev/null +++ b/solutions/python/triangle/3/triangle.py @@ -0,0 +1,21 @@ + +def is_triangle(a,b,c): + return b + a >= c and a != 0 + +def equilateral(sides): + a, b, c = sorted(sides) + return is_triangle(a,b,c) and (a == b and b == c) + +equilateral([2,2,2]) + +def isosceles(sides): + a, b, c = sorted(sides) + return is_triangle(a,b,c) and (a == b or a == c or b == c) + + +def scalene(sides): + a, b, c = sorted(sides) + return is_triangle(a,b,c) and (a not in [b,c] and b not in [a,c]) + + + \ No newline at end of file