Python:
<def main():>
<equation1t = Triangle(2,3,4)>
<equation1rt = Triangle(5,4,3)>
< listtriangle = [equation1t, equation1rt]>
< for test in listtriangle:
if test.isTriangualr():
print("The Values of", test.side1, ",", test.side2, ",", test.side3, "could be the sides of a triangle")
if test.isRightTriangular():
print("This is a right triangle! \n")
else:
print("sorry, this is not a right triangle. \n")
else:
print("The values of", test.side1, ",", test.side2, ",", test.side3, "could not be the sides of a triangle")>
if __name__ == "__main__" :
main()
Last edited by a moderator: