python triangle area

Calculating a triangle area formula: P = P = (A + B + C) / 2

          area*2=p*(p-a)*(p-b)*(p-c)

 

# Calculated area of a triangle 
a = float (input ( 'Enter the first-side length:')) 
B = a float (INPUT ( 'the second input-side length:')) 
C = a float (INPUT ( 'first input the length of the three sides: ')) 
IF a + B> C and C + a> B and B + C> a: 
    P = (a + B + C) / 2 
    S = (P * (PA) * (Pb ) * (PC)) ** 0.5 
    Print ( "triangle area: ', S) 
the else: 
    Print (" triangle is not established')

 

Guess you like

Origin www.cnblogs.com/condom/p/12417024.html