Three corners are enough to name a triangle. You will compare the squares of its sides, so that no square root ever gets rounded.
The idea. Equal squared sides mean equal sides. A right angle shows up as , with the longest side.
Your tasks.
d2, return the square of the distance between two points.kind, return "equilateral", "isosceles" or "scalene".right, return True if the triangle has a right angle.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…