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

CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad