Default parameters must come after non-default parameters:
# Correct
def greet(name, greeting="Hello"):
pass
# Wrong - causes error
def greet(greeting="Hello", name):
pass
Why? Python matches arguments by position. If the first parameter has a default but the second doesn't, Python can't tell which argument you meant.
Put required parameters first, optional parameters last.