write a Python program that takes length and breadth of the rectangular through input function and prints and find the area and perimeter of rectangle
Answers
Answer:
Program that takes length and breadth as an input and print calculated area and perimeter of the rectangle.
Explanation:
length=float(input("enter length:"))
## ( to take the length as an input by the user)
breadth=float(input("enter breadth:"))
##( to take a breath as an input by the user)
Area=length*breadth
## formula of area of rectangle
Perimeter=2* (length + breadth)
## formula of perimeter of rectangle
print(Area)
## print calculated area
print(Perimeter)
## print calculated perimeter
♣ Qᴜᴇꜱᴛɪᴏɴ :
Write a program to input length and breadth of a rectangle .Calculate and print it's area and perimeter (Phyton chapter)
★═════════════════★
♣ ᴄᴏɴᴄᴇᴘᴛ :
First we need to take input from user asking his/her for lenght and then breadth. Then we need to address how to calculate area and perimeter. It's done, Time to print !!!!
★═════════════════★
♣ ʀᴇQᴜɪʀᴇᴅ ᴄᴏᴅᴇ :
l =int(input("Length : "))
b =int(input("Breadth : "))
area = l*b
perimeter = 2*(l+b)
print("Area of Rectangle : ",area)
print("Perimeter of Rectangle : ",perimeter)