Computer Science, asked by panchaldraculasrock, 4 months ago

6. Write a function that takes length of three sides: side1, side2 and side3 of
triangle as the input from user using input function and return the area of the
triangle as the output. Also, assert that sum of length of any two sides is
greater than third side (i.e. length of sides provided form a valid triangle).

Answers

Answered by AnushGudimetla
0

Code:

side1 = int(input("Length of breadth: "))

side2 = int(input("Length of Height : "))

side3 = int(input("Length of side3 : "))

area = 1/2 * side1 * side2

sum_of_two_sides = side1 + side2

if sum_of_two_sides >  side3:

    print("Area of the triangle =  ", area )

else:

   print("Enter the valid sides of the triangle")

Similar questions