code: def passphrase_entropy(amount_w: int,
                         entropy_w: Union[int, float],
                         entropy_n: Union[int, float],
                         amount_n: int) -> float:
      
      if not isinstance(amount_w, int):
          raise TypeError('amount_w can only be int')
      if not isinstance(entropy_w, (int, float)):
          raise TypeError('entropy_w can only be int or float')
      if not isinstance(entropy_n, (int, float)):
          raise TypeError('entropy_n can only be int or float')
      if not isinstance(amount_n, int):
          raise TypeError('amount_n can only be int')
      if amount_w < 0:
          raise ValueError('amount_w should be greater than 0')
      if entropy_w < 0:
          raise ValueError('entropy_w should be greater than 0')
      if entropy_n < 0:
          raise ValueError('entropy_n should be greater than 0')
      if amount_n < 0:
          raise ValueError('amount_n should be greater than 0')
  
      return float(amount_w * entropy_w + amount_n * entropy_n)
docs: Calculate the entropy of a passphrase with given words and numbers.