Dremendo Tag Line

Calculate area of a square in Python

input() - Question 11

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

Q11) Write a program in Python to input side of a square and find its area.

Formula: area = side * side

Program

s=int(input('Enter side of a square '))
a=s*s
print('Area={}'.format(a))

Output

Enter side of a square 5
Area=25
video-poster