Area of a triangle in python
Example
Input 5 5 Output 5
Explanation
- Take base and height as input from the user.
- Use the formula to find the area of the triangle.
- Store the area in a resultant variable like area_of_traingle.
- Print the result
Formula to be used
area of a triangle = (base * height)/2
Program
base = float(input("enter the base"))
height = float(input("enter the height"))
area_of_triangle = (base * height)/2
print(area_of_triangle)