Computer Science, asked by san710, 9 months ago

need help quick!!!
Python Program to accept the length and breadth of a rectangle and display the perimeter of the rectangle

Answers

Answered by Equestriadash
9

choice = "Yes"

while choice == "Yes":

   print("Perimeter of a rectangle.")

   x = int(input("Enter the length: "))

   y = int(input("Enter the breadth: "))

   z = x*y

   print(z, "is the perimeter of the reactangle.")

   print("Would you like to find with more dimensions?")

   print("Yes/No")

   choice = input()

I've used a while loop to run the program again if the user would like to find the perimeter with more dimensions.

Answered by Anonymous
410

♣ 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)

Attachments:
Similar questions