Python program to calculate entry the area of a rectangle if the user enters one and print the area of a square if the user enters two.
Answers
Answered by
0
def rect():
l = int(input("Length: "))
b = int(input("Breadth: "))
arr = l * b
print("Area: ", arr)
def sq():
side = int(input("Side: "))
area = side * side
usr = int(input("Enter the number: "))
if usr == 1:
rect()
else:
sq()
pls mark brainliest
Answered by
0
input = str(input("Enter one or two"))
if input == "one":
l = int(input("Enter the length:")
b = int(input("Enter the breadth:")
print(l*b)
elif input == "two":
side = int(input("Enter the side:")
print(side*side)
_______________________________________________
Hope it Helps!
Similar questions