def setNibbles(hiNibble, loNibble):
    """
    Returns byte with value set according to hi and lo bits
    Asserts hiNibble and loNibble in range(16)
    >>> setNibbles(8, 14)
    142
    
    >>> setNibbles(8, 16)
    Traceback (most recent call last):
        ...
    ValueError: Nible value out of range 0-15: (8, 16)
    """
    if not 0 <= hiNibble <= 15 or not 0 <= loNibble <= 15:
        raise ValueError('Nible value out of range 0-15: (%s, %s)' % (
            hiNibble, loNibble))
    return (hiNibble << 4) + loNibble
