Home / Python Tips Generated By ChatGPT / Understanding Mutable Default Arguments in Python Avoid using mutable default arguments to prevent unexpected behavior. Source Code def append_to(element, to=None): if to is None: to = [] to.append(element) return to