input: Write a function to return the largest prime factor of a given integer n, assuming n > 1 and is not a prime.
  assert largest_prime_factor(15) == 5
  assert largest_prime_factor(27) == 3
  assert largest_prime_factor(63) == 7
  assert largest_prime_factor(330) == 11
  assert largest_prime_factor(13195) == 29
  
output: def largest_prime_factor(n):
      largest = 1
      factor = 2
      while factor * factor <= n:
          while (n % factor) == 0:
              largest = factor
              n //= factor
          factor += 1
      if n > 1:
          largest = n
      return largest