The length of rectangle is given as 10, its width is given as 20. Calculate its area and perimeter.
Hint
So your output should look like this: "The rectangle whose length is 10 and width 20 has the area 200 and perimeter 60."
#Python code to calculate the area and the perimeter of Rectangle
length = int(input("Enter the length value of rectangle: "))
width = int(input("Enter the width value of rectangle: "))
Perimeter = 2*(length+width)
Area = length*width
print ("The rectangle whose length is", length, "and width", width, "has the area", Area, "and perimeter", Perimeter,".")
Comments
Leave a comment