(char)
Tanslate a hexadecimal character his decimal (int) value.

    Args:
        char (str): A hexadecimal number in base 16.
    Returns:
        int: the base 10 representation of the number.

    Raises:
        ValueError: if `char` is not a valid hexadecimal character.
Tanslate a hexadecimal character his decimal (int) value.
Tanslate a hexadecimal character his decimal ( int ) value .
def hexdigit(char):
    """Tanslate a hexadecimal character his decimal (int) value.

    Args:
        char (str): A hexadecimal number in base 16.
    Returns:
        int: the base 10 representation of the number.

    Raises:
        ValueError: if `char` is not a valid hexadecimal character.

    """
    if char >= '0' and char <= '9':
        return ord(char) - ord('0')
    if char >= 'a' and char <= 'f':
        return 10 + ord(char) - ord('a')
    if char >= 'A' and char <= 'F':
        return 10 + ord(char) - ord('A')
    raise ValueError(repr(char) + " is not a valid hexadecimal digit")
def hexdigit ( char ) : if char >= '0' and char <= '9' : return ord ( char ) - ord ( '0' ) if char >= 'a' and char <= 'f' : return 10 + ord ( char ) - ord ( 'a' ) if char >= 'A' and char <= 'F' : return 10 + ord ( char ) - ord ( 'A' ) raise ValueError ( repr ( char ) + " is not a valid hexadecimal digit" )