Program to check whether the given shape is square

In this python if else program we will, take values of the length and breadth of a rectangle from the user and check if the shape is square or not.

Rectangle: A rectangle is a type of quadrilateral, whose opposite sides are equal and parallel.

Steps to solve the program
  1. Take the length and breadth of the rectangle as input.
  2. The area of the square is the side’s square and the area of a rectangle is length*breadth.
  3. Using an if-else statement check whether both of these values are equal or not.
  4. Print the respective output.
				
					length = int(input("Enter length: "))
breadth = int(input("Enter breadth: "))

if length**2 == length*breadth:
    print("It is a square")
else:
    print("It is not a sqaure")
				
			

Output :

				
					Enter length: 5
Enter breadth: 4
It is not a sqaure
				
			

Related Articles

find employees eligible for bonus..

Calculate the discount based on the bill.

Leave a Comment