code: def password_entropy(length: int, chars: str) -> float:
      
      if not isinstance(length, int):
          raise TypeError('length can only be int')
      if length < 0:
          raise ValueError('length should be greater than 0')
      if not isinstance(chars, str):
          raise TypeError('chars can only be string')
      if not chars:
          raise ValueError("chars can't be null")
  
      if length == 0:
          return 0.0
  
      entropy_c = entropy_bits(list(chars))
      return float(length * entropy_c)
docs: Calculate the entropy of a password with given length and chars.