The garments company Apparel wishes to
open outlets at various locations. The company
shortlisted several plots in these locations and
wishes to select only plots that are square-
shaped.
Write an algorithm to help Apparel find the
number of plots that it can select for its outlets.
# getting the number of the plots
n = int(input("Enter the number of the plots: "))
# initial number of the square plots
number = 0
# getting length and width of the plots
for i in range(n):
length = int(input("Enter the length : "))
width = int(input("Enter the width : "))
if length == width:
number = number + 1
# printing total number of the square plots
print("Total number of the square plots: ",number)
Comments
Leave a comment