write a python code to find the area of a triangle whose base and height is given
Answers
Answered by
1
Area of Triangle - Python
Simply take in the user input of the base and height and store them as float values.
The Area of Triangle is given by:
Calculate this and print it out.
Here's the code.
# Program to find area of trinagle when base and height are given
# Take input of Base
base = float(input("Enter the base: "))
# Take input of height
height = float(input("Enter the height: "))
# Area of triangle = (1/2) * base * height
area = 0.5 * base * height
# Print out the area
print(f"Area of the triangle is {area} sq units.")
Attachments:
Similar questions