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)
▶ RUN

Output/ Explanation:

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

Latest Current Affairs 2025 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad