<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def password_entropy(length: int, chars: str) -> float: """Calculate the entropy of a password with given length and chars."""

    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)