Find the altitude and area of an isosceles triangle | Python 3 program to find the Altitude Area of an isosceles triangle ; function to find the altitude ; return altitude ; function to find the area ; return area ; Driver Code
import math NEW_LINE def altitude ( a , b ) : NEW_LINE INDENT return math . sqrt ( pow ( a , 2 ) - ( pow ( b , 2 ) / 4 ) ) NEW_LINE DEDENT def area ( b , h ) : NEW_LINE INDENT return ( 1 * b * h ) / 2 NEW_LINE DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT a = 2 NEW_LINE b = 3 NEW_LINE h = altitude ( a , b ) NEW_LINE print ( " Altitude ▁ = ▁ " + str ( round ( h , 3 ) ) , end = " , ▁ " ) NEW_LINE print ( " Area ▁ = ▁ " + str ( round ( area ( b , h ) , 3 ) ) ) NEW_LINE DEDENT