A Square is a planar shape which have all of its sides being equal like a closed shape having sides as 4, 4, 4, 4 will be a Square. Mathematically perimeter of Square is defined as four times of side of square. Simple if side of square is s then perimeter of square will be 4 * s.
Let’s Program this as Python Code for Finding Perimeter of Square.
# Calculating Perimeter of Square Using Python
s = float(input("Enter Side of Square => "))
# Perimeter of Square
perimeter_of_square = 4 * s
# Printing out parameter of Rectangle
print("Perimeter of Square is =>", perimeter_of_square)
Output of Above Code
Enter Side of Square => 5
Perimeter of Square is => 20.0
No Comments
Leave a comment Cancel