A very common error in Python is the use of an empty list as a default argument to a function. This is not the right way to do it and can cause unwanted behavior. See for example below:
def append_to_list(element, list_to_append=): list_to_append.append(element) return list_to_append >>> a = append_to_list(10)  >>> b = append_to_list(20) [10, 20] This is not the behavior we wanted! A new list is created once when the function is defined, and the same list is used in each successive call.