You should do result.append(value) instead of result = value. "result.append(value)" will add the value to the end of the "result" list, where "result = value" will assign value to the result variable.