Table of Contents

Find the Area of a Rectangle | Pictoblox

Example Description
Learn how to find the area of a rectangle using Python with this simple code using the formula length * breadth.

Introduction:

Learn how to calculate the area of a rectangle with Python! Our code example shows you how to find the area by multiplying the length with the breadth. See the result for a given length of 10 and breadth of 20. Start mastering rectangle area calculations now!”

Code:

length = 10
breadth = 20
area = length * breadth
print(area)

Logic:

  1. Assign the value 10 to the variable “length” to represent the length of the rectangle.
  2. Assign the value 20 to the variable “breadth” to represent the breadth (width) of the rectangle.
  3. Calculate the area of the rectangle by multiplying the values of “length” and “breadth” and store the result in the variable “area.”
  4. Print the calculated area using the “print” function.

Output:

In summary, the code calculates the area of a rectangle with a length of 10 and breadth of 20 and displays the result, which would be 200.

>> 200