Answer to Question #159651 in Python for Suresh

Question #159651

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.


1
Expert's answer
2021-01-29T13:50:41-0500
# 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)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS