class Triangle:
def __init__(self,a,b,c):
self.cotes = [a, b, c]
self.cotes.sort()
def rect(self):
return self.cotes[2]**2 == self.cotes[0]**2 + self.cotes[1]**2
def aire(self):
if self.rect():
return self.cotes[0] * self.cotes[1] / 2
else:
p = (self.cotes[0] + self.cotes[1] + self.cotes[2])/2
return (p*(p-self.cotes[0])*(p-self.cotes[1])*(p-self.cotes[2]))**0.5