+ 1
Why it is error in python and what should I do?
#Area of a rectangle def rect_area(width, height): width = int(input()) height = int(input()) print(width*height) rect_area(width,height)
2 Answers
+ 3
Write the input statements outside the function.
like this :
def rect_area(width, height):
print(width*height)
width = int(input())
height = int(input())
rect_area(width,height)
+ 1
Thank you very much brother :)