input: Write a python function to remove non-prime numbers from a list.
  assert remove_non_primes([1, 2, 3, 4, 5, 6, 7, 8]) == [1, 2, 3, 5, 7]
  assert remove_non_primes([10, 11, 12, 13, 14, 15]) == [11, 13]
  assert remove_non_primes([17, 18, 19, 20, 21, 22, 23]) == [17, 19, 23]
output: def remove_non_primes(lst):
      def is_prime(n):
          if n <= 1:
              return False
          if n == 2:
              return True
          if n % 2 == 0:
              return False
          for i in range(3, int(n**0.5) + 1, 2):
              if n % i == 0:
                  return False
          return True
      
      return [x for x in lst if is_prime(x)]