class Triangle:
def __init__(self,x,y,z):
self.x = x
self.y = y
self.z = z
def perimeter(self):
return self.x + self.y + self.z
def area(self):
ang = acos(self.y^2 - self.x^2 - self.z^2 / -2 * self.x * self.z)
h = sin(ang) * self.x
return self.z * h / 2
triangle = Triangle(input("Please input one side length of triangle:"),\
input("Please input another side length of triangle:"),\
input("Please input base of triangle:")):
if x > y and x > z and x > y + z:
pass
elif y > x and y > z and y > x + z:
pass
elif z > x and z > y and z > x + y:
pass
else:
print "Not A Valid Triangle"
print triangle.perimeter()
print triangle.area()
The above is my code for creating a triangle's area and perimeter. When I run it says
that the colon after my input statements is invalid syntax. I want to link the input
with the if statement. Any help is appreciated.