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 area of Square is defined as multiplying side by side so area of Square having side as a will be a * a.
Let’s Program this as Python Code for Finding Area of Square.
# Finding Area of a Square using Python
# Ask user for side of Square
side = float(input("Enter Side of Square => "))
# Calculate Area of Square
area_of_square = side * side
# Print out Area of Square
print("Area of Square is =>", area_of_square)
Output of Above Code
Enter Side of Square => 5
Area of Square is => 25.0
No Comments
Leave a comment Cancel