Write a python program to accept length and width of a rectangle and compute its perimeter and area
Answers
Explanation:
# Python Program to find Perimeter of a Rectangle using length and width
length = float(input('Please Enter the Length of a Triangle: '))
width = float(input('Please Enter the Width of a Triangle: '))
# calculate the perimeter
perimeter = 2 * (length + width)
print("Perimeter of a Rectangle using", length, "and", width, " = ", perimeter)
Answer:
CODE:
length=float(input('Please Enter the Length of a Triangle: '))
width=float(input('Please Enter the Width of a Triangle: '))
perimeter=2*(length+width)
area=(length*width)
print("preimeter of a rectamgle is",perimeter)
print("preimeter of a rectamgle is",area)
OUTPUT:
Please Enter the Length of a Triangle: 2
Please Enter the Width of a Triangle: 2
preimeter of a rectamgle is 8.0
preimeter of a rectamgle is 4.0