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):
      # Keep track of the prime numbers
      primes = []
      
      # Iterate through each number
      for num in nums:
          if num > 1:  # Only positive integers greater than 1 can be prime
              is_prime = True
              # Check if the number is divisible by any number from 2 to itself
              for i in range(2, num):
                  # If so, the number is not prime
                  if num % i == 0:
                      is_prime = False
                      break
              # Add the number to the list of primes if it is prime
              if is_prime:
                  primes.append(num)
                  
      # Return the updated list
      return primes
  
  assert filter_prime([2, 3, 4, 5, 6, 7, 8, 9, 10]) == [2, 3, 5, 7]
  assert filter_prime([]) == []
  assert filter_prime([4, 6, 8, 9, 10]) == []
  assert filter_prime([1]) == []
  assert filter_prime([2, 3, 5, 7, 11, 13]) == [2, 3, 5, 7, 11, 13]
output: def filter_prime(nums):
      primes = []
      for num in nums:
          if num > 1:
              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