Skip to content

Commit 2819d41

Browse files
committed
Finished AboutTriangleProject
1 parent 581b25a commit 2819d41

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

python2/koans/triangle.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@
1818
# about_triangle_project_2.py
1919
#
2020
def triangle(a, b, c):
21-
# DELETE 'PASS' AND WRITE THIS CODE
22-
pass
23-
24-
21+
if a == b == c:
22+
return 'equilateral'
23+
elif a == b or a == c or c == b:
24+
return 'isosceles'
25+
else:
26+
return 'scalene'
2527
# Error class used in part 2. No need to change this code.
2628
class TriangleError(StandardError):
2729
pass

0 commit comments

Comments
 (0)