The maths teacher has given a task to the students to write a python script to enter the side of a square and display its area and perimeter.can you do this task?
Answers
Answered by
0
In order to write the program we need the formula for Perimeter and Area of a square
A square always has 4 equal sides.
Perimeter = 4 X Side
Area = Side X Side
Program:
s= int(input (“Side: “))
area = s * s
perimeter = 4 * s
print(“Area of Square:”, area)
print(“Perimeter of square: “ , perimeter);
Output:
Side: 10
Area of Square = 100
Perimeter of square = 40
Similar questions
Social Sciences,
6 months ago
Math,
6 months ago
Geography,
11 months ago
Chemistry,
1 year ago
Science,
1 year ago