input: Write a function to filter out a list of numbers and keep only those that are prime. If the given list is empty then return an empty list.
  def filter_prime(nums):
      if not nums:
          return []
      primes = [num for num in nums if all(num % i != 0 for i in range(2, int(num**0.5) + 1)) and num > 1]
      return primes
  assert filter_prime([2, 3, 4, 5, 6, 7, 8, 9, 10])==[2, 3, 5, 7]
  assert filter_prime([11, 12, 13, 14, 15])==[11, 13]
  assert filter_prime([16, 17, 18, 19, 20])==[17, 19]
  assert filter_prime([21, 22, 23, 24, 25])==[23]
  assert filter_prime([])==[]
output: def filter_prime(nums):
      if not nums:
          return []
      primes = [num for num in nums if all(num % i != 0 for i in range(2, int(num**0.5) + 1)) and num > 1]
      return primes