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:
          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 =
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