I need help with programming in python. The following statement:
a, b, c refer to three lengths. Determine if it can construct a triangle. If yes, specify the type of triangle.
That's what I did, it seems a little more complicated and it does not work, though I find the problem I can not find it!
Code:from math import * a=raw_input("dimension of the side BC: " ) b=raw_input("dimension of the side AC: " ) c=raw_input("dimension of the side AB: " ) a=float(a) b=float(b) c=float(c) x1=asin(a/c) x2=asin(b/c) x3=atan(c/b) x=x1+x2+x3 if x==pi: if x1==(pi/2) or x2==(pi/2) or x3==(pi/2): print "ABC is a triangle" elif x1==x2 or x2==x3 or x1==x3: print "ABC is a isosceles triangle" elif x1==x2 and x2==x3 and x3==(pi/3): print "ABC is an equilateral triangle" else: print "ABC is any triangle" else: print "ABC isn't a triangle"
Bookmarks