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):
      primes = []
      for num in nums:
          is_prime = True
          for i in range(2, num):
              if num % i == 0:
                  is_prime = False
                  break
          if is_prime:
              primes.append(num)
      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([])==[]
output: def filter_prime(nums):
      primes = []
      for num in nums:
          if num > 1:
              is_prime = True
              for i in range(2, int(num**0.5) + 1):
                  if num % i == 0:
                      is_prime = False
                      break
              if is_prime:
                  primes.append(num)
      return primes