After I edited my code, I got the answer:
def sum_factors(n): sum = 0 factor = 1 # Return the sum of all factors of n, not including n while n!=0 and