Python — Avoid this common mistake of writing functions with default parameters

Python default parameters

Writing functions with default arguments seems like a fairly straightforward task. Default the argument in the function definition and you’re all set. That’s right works like a charm as shown in the following example.

def greetings(name, message = "Good Day"):
print(f'Hello {name}. Have a {message}')