I'm very new to programing, anyways, i was instructed to crate a program to calculate the are of rectangle, using the input from the user ( width, lenght ) using functions

here is what i have, but i'm getting a error at the end

recWidth = input ('Please enter the  Width of the rectangle ')
recLength = input ('Please enter the Length of rectangle ')

#fuction
def recArea (recWidth, recLength):
    result = recWidth * recLength
    return result

print "The are of your Rectangle is", recArea

Recommended Answers

All 2 Replies

You forgot to pass in the arguments in the last line.

print "The are of your Rectangle is", recArea(recWidth, recLength)

You forgot to pass in the arguments in the last line.

print "The are of your Rectangle is", recArea(recWidth, recLength)

thank you sir

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.