Small Function Syntax Best Practice Question

I’ve looked through naming and readable code best practices but can’t find the answer I’m looking for. I know we want simplicity but we also want easy to modify and re-use code as well.

When writing a simple function that will return a value, is it better to create a variable for that value then return the variable or is it better just to have the return do all the calculation? For instance:

def calculate_area(length, width):
area = length * width
return area


def calculate_area(length, width):
return length * width

Having the area variable declared means I could add onto a function later or change it easier but is the simplicity of the second example more preferred?

@fisherman_188 Welcome to the forums! I think the first option would be the preferred option because it is easier to modify.