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: pre id (print " 2: "angle") like = input () if preferred == 1: print ("\ nType at all sides length.") T1 = input ("1:") T2 = input ("2:" ) T3 = Input ("3:") Print ("Your triangle is a parallel triangle.") Menu () elif choice == 2: pass idtri ()

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:

  id_triangle = lambda a, b, c: {0: 's Kelene ', 1:' isocale ', 3:' assorted '} \ [(a == b) + (a == c) + (b == c)]   

Then call your interactive script, like:

  print ('your triangle is% s.'% Id_triangle (t1, t2, t3))    

Comments

Popular posts from this blog

java - NullPointerException for a 2d Array -

python - Assemble mpeg file unable to play in mediaplayer -

c# - NameSpace Manager or XsltContent to parse aspx page -