Why am I getting an error in my function?

Can someone help me figure out why my function is not running?

def area (x, y):
    return x * y
#Main
length = int(input("Length: "))
width = int(input("Width: "))
print area (length, width)

Do you mean to be using Python 2 syntax? Python 2 is dead.

If I fix your print to use Python 3 syntax, it seems to work fine for me.

1 Like