Python program to find area and perimeter of rectangle; Through this tutorial, i will show you how to obtain height and width of a rectangle and calculate or find its area and perimeter of rectangle in python program.

**Note that:- **To find the **area** of a **rectangle**, multiply the length by the width. And the formula of calculate or find Area of Rectangle is; as shown below:

Area = Width * Height

Perimeter is the distance around the edges. You can calculate or find perimeter of a rectangle using the following formula in program:

Perimeter = 2 * (Width + Height)

## Python Program to Calculate the Area of Rectangle

- Python Program to find the Area of a Rectangle and Perimeter of a Rectangle
- Python Program to Calculate the Area of a Rectangle using Function

### Python Program to find the Area of a Rectangle and Perimeter of a Rectangle

Now, i will write a program to find the Area of a Rectangle and Perimeter of a Rectangle in Python:

- Get input the Width and Height of a rectangle in program from user.
- Calculate or find the area as per the formula
**Area = width * height**. - Calculate or find the Perimeter of a rectangle
**Perimeter = 2 * (width + height)**. - Print the Perimeter and Area of a rectangle.

# Write a Program to find the Area of a Rectangle and # Perimeter of a Rectangle in Python w = float(input('Please Enter the Width of a Rectangle: ')) h = float(input('Please Enter the Height of a Rectangle: ')) # calculate the area Area = w * h # calculate the Perimeter Perimeter = 2 * (w + h) print("\n Area of a Rectangle is: %.2f" %Area) print(" Perimeter of Rectangle is: %.2f" %Perimeter)

After executing the python program, the output will be:

Please Enter the Width of a Rectangle: 10 Please Enter the Height of a Rectangle: 5 Area of a Rectangle is: 50.00 Perimeter of Rectangle is: 30.00

**Recommended:-**Python Program to Convert cm to Feet and Inches

### Python Program to Calculate the Area of a Rectangle using Function

Use the following steps to calculate the area of a rectangle using function in python:

- Defined the function with two arguments using def keyword.
- Find the perimeter and Area of a rectangle inside functions.
- Get input the Width and Height of a rectangle from user.
- Print the Perimeter and Area of a rectangle.

# Write a Program to find the Area of a Rectangle and # Perimeter of a Rectangle in Python using functions def AreaOfRectangle(width, height): # calculate the area Area = width * height # calculate the Perimeter Perimeter = 2 * (width + height) print("\n Area of a Rectangle is: %.2f" %Area) print(" Perimeter of Rectangle is: %.2f" %Perimeter) width = float(input('Please Enter the Width of a Rectangle: ')) height = float(input('Please Enter the Height of a Rectangle: ')) AreaOfRectangle(width, height)

After executing the python program, the output will be:

Please Enter the Width of a Rectangle: 15 Please Enter the Height of a Rectangle: 5 Area of a Rectangle is: 75.00 Perimeter of Rectangle is: 40.00

## Recommended Python Tutorials

**Recommended:-**Python Program to Calculate Compound Interest

**Recommended:-**Python Program to Check Leap Year

**Recommended:-**Python Program To Print Number Pattern

**Recommended:-**Python Program to Print Star Pattern

**Recommended:-**Python Program Calculate Sum of n Numbers

**Recommended:-**Python Program to Reverse Numbers

**Recommended:-**Python Program to Find Largest of n Numbers

**Recommended:-**Python Program to Find Power of Number

**Recommended:-**Python Program to Print Prime Number From 1 to N

**Recommended:-**Python Program to Find Square Root of Number

**Recommended:-**Python Program to Find Cube of Number

**Recommended:-**Python Palindrome Program

**Recommended:-**Python Program to Count Set Bits in a Number

**Recommended:-**Python Program for BMI Calculation

**Recommended:-**Python Program to Find Out Absolute Value

**Recommended:-**Python Random Number Generator Code

**Recommended:-**Python program for Zip, Zap and Zoom game

**Recommended:-**Python Program to Swap Two Numbers

**Recommended:-**Python Program to Find n-th term of Fibonacci Series

**Recommended:-**Python Program For Calculator

**Recommended:-**Python Program to Find Strong Number

## Be First to Comment