Based on this
A positional argument is a name that is not followed by an equal sign (=) and default value.
A keyword argument is followed by an equal sign and an expression that gives its default value.
def rectangleArea(width, height):
return width * height
print rectangleArea(width=1, height=2)
Question> I assume that both width
and height
are positional arguments. Then why can we also call it with the keyword argument syntax?
This question is related to
python
Source: Stackoverflow.com