input: from typing import Union
  
  def is_prime(num: Union[int, str]) -> bool:
      """Determine if a given number is prime.
      >>> is_prime(17)
      True
      >>> is_prime(4)
      False
      >>> is_prime('17')
      True
      >>> is_prime('4')
      False
      """
      try:
          num = int(num)
      except ValueError:
          return False
      if num < 2:
          return False
      for i in range(2, int(num ** 0.5) + 1):
          if num % i == 0:
              return False
      return True
output:     try:
          num = int(num)
      except ValueError:
          return False
      if num < 2:
          return False
      for i in range(2, int(num ** 0.5) + 1):
          if num % i == 0:
              return False
      return True