Dremendo Tag Line

Calculate area of a rectangle in Python

input() - Question 12

In this question, we will see how to input length and breadth of a rectangle in Python programming using the input() function and find its area. To know more about input() function click on the input() function lesson.

Q12) Write a program in Python to input length and breadth of a rectangle and find its area.

Formula: area = length * breadth

Program

l=int(input('Enter length of a rectangle '))
b=int(input('Enter breadth of a rectangle '))
a=l*b
print('Area={}'.format(a))

Output

Enter length of a rectangle 10
Enter breadth of a rectangle 5
Area=50
video-poster