Question: In this assignment you will need to create a Python fruitful function (a fruitful function is one that returns a value) called kind(a, b, c)
In this assignment you will need to create a Python fruitful function (a fruitful function is one that returns a value) called kind(a, b, c) which yields an integer. The lengths of the side are a, b, and c. The function returns as follows:
0 No triangle can be created
1 The triangle is equilateral (all three sides are the same length)
2 The triangle is isosceles (two sides are the same length, but not all three)
3 The triangle is a right triangle (a2 + b2 = c2)
4 The triangle acute (all the angles in the triangle are less than 90 degrees)
5 The triangle is obtuse (none of the above cases apply)
Write a function called name(k) that accepts a kind value and returns the name of this kind of triangle. The names are: no triangle, equilateral, isosceles, right, acute, and obtuse.
Write a main driving program that repeatedly accepts 3 integers from the user and then reports what kind of triangle (if any) can be formed. It should use kind() and name() to accomplish this. You must not assume that the lengths always will be input in non-decreasing order. Your program should continue to request inputs until any one of the lengths is less than one.
Demonstrate your program works by giving it these lengths plus at least 3 more of your own selection.
1, 2, 33
5, 5, 5
6, 6, 4
3, 4, 5
7, 8, 9
4, 5, 8
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
