gregmalcolm / python_koans

Python Koans - Learn Python through TDD
MIT License
4.95k stars 2.83k forks source link

about_triangle_project2.py unclear #96

Closed tombusby closed 10 years ago

tombusby commented 10 years ago

On lines 18 and 19:

self.assertNotRaises(TriangleError, triangle, 1, 1, 3) self.assertNotRaises(TriangleError, triangle, 2, 5, 2)

I don't understand why those are considered invalid triangles. The fact that there is a valid type of triangle called "scalene" means that it can't be because they aren't valid right angle triangles.

The fact they don't conform to Pythagoras Theorem is the only thing I can think of.

gregmalcolm commented 10 years ago

Try taking 3 stripes of paper of measurements 1 inch, 1inch and 3 inches and joining them together as a triangle and you'll see what we mean... ;)

tombusby commented 10 years ago

Ahh, of course, the addition of the two smallest is shorter than the longest, meaning even with an angle of zero they wouldn't reach, got it!

Also: love this repo btw, coolest way to learn a language ever. Get so tired of writing hello world and learning what a string is in a thousand different languages

gregmalcolm commented 10 years ago

Glad you like it :)