base = int(input("Input the value of the base :")) #Enter the base of the triangle
height = int(input("Input the value of the height :")) #Enter the height of the triangle
area = base*height/2 # Formula for computing the area
print("The area of the triangle is =", area) #Display the area of the triangle
Input the value of the base :12
Input the value of the height :15
The area of the triangle is = 90.0
First understand the algorithm carefully. Then study the program line-by-line and compare it with the output. Finally, review the explanation section to strengthen your logic and programming understanding.
Rewrite the program without looking at the code. Modify values, conditions or logic and run it again. This helps improve confidence and strengthens coding skills much faster.