Q. Write a program in python for accepting input of length and breadth from the user and then calculate and display area of rectangle and perimeter of rectangle.
Share
Q. Write a program in python for accepting input of length and breadth from the user and then calculate and display area of rectangle and perimeter of rectangle.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Verified answer
Answer:
The following python co.de should be used:
l=int(input("Length : ") )
w=int(input("Width : ") )
area=l × w
perimeter=2×(l+w)
print("Area of Rectangle : ",area)
print("Perimeter of Rectangle : ",perimeter)
Explanation:
#python program to find area of a rectangle
Width= float (input ('please enter the width of a rectangle:'))
Height= float (inter ('please enter the height of a rectangle:'))
# calculate the area
Area= length × breadth
#calculate the perimeter
Perimeter= 2×(width+hight)
Print ("/n Area of a rectangle is: % . 2f " % Area )
Print (" Perimeter of rectangle is: % . 2f " % Perimeter)
Area_of_a_Rectangle(6,4)