We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 68e5e7a commit 56fbaeaCopy full SHA for 56fbaea
1 file changed
python2/koans/triangle.py
@@ -18,6 +18,11 @@
18
# about_triangle_project_2.py
19
#
20
def triangle(a, b, c):
21
+ if a <= 0 or b <= 0 or c <= 0:
22
+ raise TriangleError, "Values must be greater zero"
23
+ if a > b + c or b > a + c or c > a +b:
24
+ raise TriangleError, "One value must not be bigger than " + \
25
+ "the sum of the others"
26
if a == b == c:
27
return 'equilateral'
28
if a == b or b == c or a == c:
0 commit comments