Skip to content

Commit 56fbaea

Browse files
committed
Completed about_triangle_project2
1 parent 68e5e7a commit 56fbaea

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

python2/koans/triangle.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
# about_triangle_project_2.py
1919
#
2020
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"
2126
if a == b == c:
2227
return 'equilateral'
2328
if a == b or b == c or a == c:

0 commit comments

Comments
 (0)