If the candidate correctly deduces what will happen, I'll ask them to write a bug-free version, which looks like one of the below:
def append_one(var=None):
var = var or []
var.append(1)
return var
def append_one(var=None): if var is None:
var = []
var.append(1)
return var
Mutability is a very subtle but very important concept to understand in python. Everyone who uses python for non-trivial code should know it well: https://docs.python.org/2/reference/datamodel.html