Computer Science, asked by shivanivijayaraghava, 10 months ago

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 lovingheart
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