Write a program that prompts the user to input the length and the width of a rectangle and outputs the area and perimeter of the rectangle. The formula is
Area = Length x Width
Perimter = 2 x (Length + Width)
Source Code
length = int(input("Enter the length of the rectangle: "))
width = int(input("Enter the width of the rectangle: "))
area = length * width
perimeter = 2 * (length + width)
print("The area of the rectangle is:", area)
print("The perimeter of the rectangle is:", perimeter)
Output
Enter the length of the rectangle: 15
Enter the width of the rectangle: 9
The area of the rectangle is: 135
The perimeter of the rectangle is: 48