Write a simple program using python
A. Write a program to enter 2 numbers and display a message that
these two entered Numbers are representing “Square",
Rectangle"
Answers
Answered by
1
Answer :-
length = int(input("Enter a number"))
breadth = int(input("Enter another number"))
if length==breadth:
print("square")
else:
print("rectangle")
Note :
* I have taken input in int , which necessarily means that user must input in integer form . You can change your data type to float if necessary
Explanation:
I have imputed 2 numbers in integer form from the user. I then checked is both the sides equal as in a square . If yes , then it's a square and if not , it goes to the else block (which specifies that length and breadth are not equal) and hence it is a rectangle
Similar questions
Math,
7 months ago