input: Write a python function to find the highest prime factor of a given number.
  assert prime_factor(10) == 5
  assert prime_factor(15) == 5
  assert prime_factor(21) == 7
  assert prime_factor(33) == 11
output: def prime_factor(n):
      def is_prime(x):
          if x <= 1:
              return False
          for i in range(2, int(x ** 0.5) + 1):
              if x % i == 0:
                  return False
          return True
  
      highest_prime = 1
      factor = 2
      while factor <= n:
          if n % factor == 0:
              if is_prime(factor):
                  highest_prime = factor
              n //= factor
          else:
              factor += 1
      return highest_prime