![Programming-Python-courses-programming techniques as well as OOP.](https://1.bp.blogspot.com/-T3BongcoJFo/X4CftQxVL8I/AAAAAAAAB5U/Lf59WgNyhGo2FdogKqxv0PIy_Ef7XDPdgCLcBGAsYHQ/s0/my-python-courses-python-exercises-with-solutions.png)
Exercise 43
Write a python program that asks the user to enter the height and base of a triangle and returns the area of the triangle.
Solution
# ask user to enter height of triangle
h = float(input("Enter height value of triangle : "))
# ask user to enter base of triangle
b = float(input("Enter base value of triangle : "))
# calculatigng the area of triangle
area = b*h/2
# disply result
print("The area of triangle is Area = " , area)
# Example for h = 7 and b = 8 the out put is :
# The area of triangle is Area = 28.0
Younes Derfoufi
my-courses.net
my-courses.net