Programming Examples
Python program to calculate area and perimeter of a parallelogram
Program to calculate area and perimeter of a parallelogram
Solution
l=float(input("Enter length"))
w=float(input("Enter width"))
h=float(input("Enter height:"))
area_parallelogram=l*h
peri_parallalogram=2*l+2*w
print ("The area of the parallelogram is", area_parallelogram)
print(" The perimeter of the parallelogram is", peri_parallalogram)
Output
Enter length5.2
Enter width2.0
Enter height:1.5
The area of the parallelogram is 7.800000000000001
The perimeter of the parallelogram is 14.4