python - I'm making a triangle class finder and I'm stuck -
I am coding a program that lets you type in the side of three angles or triangles, and it states that Is it equilateral, contemporary, etc. I am not worried about the rest, but I am stuck on its equivalent. Here is my code: The first thing to notice is that the triangle has to be made of scalyin, isocale, or alloy It does not matter if you have three values, angle or side length, process: If all three values are the same, the triangle is the right angled; otherwise, if you have Any two values are equal, triangle isoceles; otherwise, the triangle is scalin. Then you can write a simple task to return the type depending on the number of identical values provided Are: Then call your interactive script, like:
id_triangle = lambda a, b, c: {0: 's Kelene ', 1:' isocale ', 3:' assorted '} \ [(a == b) + (a == c) + (b == c)]
print ('your triangle is% s.'% Id_triangle (t1, t2, t3))
Comments
Post a Comment