

def prime_factors(number):
    factors = []
    if number > 1:
        for num in range(2, number):
            if (number % num) == 0:
                factors.append(num)
                return factors
                break
            else:
                return True
    else:
        return factors



def prime_factors(number, n=2, factors=None):
    if factors is None:
        factors = []
    for num in range(n, number):
        if (number % num) == 0:
            factors.append(num)
            return prime_factors(number // num, num, factors)
    else:
        return factors

Add two more arguments with function
Add two more arguments with function

  
  
- def prime_factors(number):
+ def prime_factors(number, n=2, factors=None):
+     if factors is None:
-     factors = []
+         factors = []
-     if number > 1:
-         for num in range(2, number):
+     for num in range(n, number):
-             if (number % num) == 0:
+         if (number % num) == 0:
-                 factors.append(num)
+             factors.append(num)
+             return prime_factors(number // num, num, factors)
-                 return factors
-                 break
-             else:
-                 return True
      else:
          return factors
  
Add two more arguments with function
## Code Before:


def prime_factors(number):
    factors = []
    if number > 1:
        for num in range(2, number):
            if (number % num) == 0:
                factors.append(num)
                return factors
                break
            else:
                return True
    else:
        return factors

## Instruction:
Add two more arguments with function
## Code After:


def prime_factors(number, n=2, factors=None):
    if factors is None:
        factors = []
    for num in range(n, number):
        if (number % num) == 0:
            factors.append(num)
            return prime_factors(number // num, num, factors)
    else:
        return factors
