Answer to Question #269682 in Python for simi

Question #269682

The length of rectangle is given as 10, its width is given as 20. Calculate its area and perimeter.

Hint

  1. Assign variables to the length and width of the rectangle
  2. Assign another variable to the calculated area and perimeter
  3. Include your answer in a sentence using Python's f-string literal or Python's .format().

So your output should look like this: "The rectangle whose length is 10 and width 20 has the area 200 and perimeter 60."

1
Expert's answer
2021-11-21T13:50:42-0500
#Python code to calculate the area and the perimeter of Rectangle
length = int(input("Enter the length value of rectangle: "))
width = int(input("Enter the width value of rectangle: "))
Perimeter = 2*(length+width)
Area = length*width
print ("The rectangle whose length is", length, "and width", width, "has the area", Area, "and perimeter", Perimeter,".")

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS