FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python_koans/python3/koans/about_triangle_project.py at master · arksega/python_koans · GitHub
arksega
python_koans
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
python_koans
/
python3
/
koans
/
about_triangle_project.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
23 lines (18 loc) · 914 Bytes
Breadcrumbs
python_koans
/
python3
/
koans
/
about_triangle_project.py
Copy path
File metadata and controls
23 lines (18 loc) · 914 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from
runner
.
koan
import
*
# You need to write the triangle method in the file 'triangle.py'
from
.
triangle
import
*
class
AboutTriangleProject
(
Koan
):
def
test_equilateral_triangles_have_equal_sides
(
self
):
self
.
assertEqual
(
'equilateral'
,
triangle
(
2
,
2
,
2
))
self
.
assertEqual
(
'equilateral'
,
triangle
(
10
,
10
,
10
))
def
test_isosceles_triangles_have_exactly_two_sides_equal
(
self
):
self
.
assertEqual
(
'isosceles'
,
triangle
(
3
,
4
,
4
))
self
.
assertEqual
(
'isosceles'
,
triangle
(
4
,
3
,
4
))
self
.
assertEqual
(
'isosceles'
,
triangle
(
4
,
4
,
3
))
self
.
assertEqual
(
'isosceles'
,
triangle
(
10
,
10
,
2
))
def
test_scalene_triangles_have_no_equal_sides
(
self
):
self
.
assertEqual
(
'scalene'
,
triangle
(
3
,
4
,
5
))
self
.
assertEqual
(
'scalene'
,
triangle
(
10
,
11
,
12
))
self
.
assertEqual
(
'scalene'
,
triangle
(
5
,
4
,
2
))
Back
|
FazBrowse Home
|
New Git URL