Python, Python Code

Write a python program to print the area of a triangle and rectangle. Values of B and H will be taken from user.

Less than a minute to read

In this program find the print the area of a triangle and rectangle. Values of B and H will be taken from user.

print(" Area of rectangle ")
B = int(input(' enter 1st dimension ' ))
H = int(input(' enter 2nd dimension ' ))
print(" area of rectangle of above dimensions is " + str(B*H) + " m^2 ")
print( " area of triangle of above dimensions is " + str(B*H*1/2) + " m^2 ")

Output


Leave a Reply

Your email address will not be published. Required fields are marked *

Sign up for our Newsletter

Join our newsletter and get resources, curated content, and design inspiration delivered straight to your inbox.