ModdersCentral

Full Version: Python area of triangle
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Code:
import math

side1=float(input("Enter first side: "))
side2=float(input("Enter second side: "))
side3=float(input("Enter third side: "))

s=(side1 + side2 + side3) / 2
area=math.sqrt(s*(s-side1)*(s-side2)*(s-side3))

print("Area of the triangle is: ",round(area,2))
www.000webhost.com