def bitOfByte(bit, byte):
    """ returns a 0 or 1: the value of the 'bit' of 'byte' """
    if bit < 0 or bit > 7:
        print(('Your bit of', bit, 'is out of range (0-7)'))
        print('returning 0')
        return 0
    return byte >> bit & 1
