Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given the lengths of three legs of a potential triangle, write a function to classify the type of triangle that results: Equilateral (all sides are

Given the lengths of three legs of a potential triangle, write a function to classify the type of triangle that results:

  • Equilateral (all sides are the same length),
  • Isosceles (exactly two sides have the same length),
  • Scalene (all sides are different lengths) or
  • Invalid (the sum of the two smaller sides are not longer than the longest side. See hint below 1 )

Note: your program should accept the legs of the triangle in any order. For example:

triangle_classify(3,4,4)

Isoceles

triangle_classify(4,3,4)

Isoceles

You should also write a test function that demonstrates that your code works (i.e. the expected output matches the actual output for a variety of cases.

Important Note: we are using the programming language PYTHON

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Genetic Databases

Authors: Martin J. Bishop

1st Edition

0121016250, 978-0121016258

More Books

Students also viewed these Databases questions

Question

Tell the merits and demerits of Mendeleev's periodic table.

Answered: 1 week ago