def bitarray2int(bitarray):
    
    """ Changes array's base from binary (base 2) to int (base 10).
    
    Parameters:
    
    bitarray: Binary Array.

    >> Examples: bitarray2int([1, 1, 0]) returns 6
                 bitarray2int([0, 0, 1, 1,0]) returns 6
                 bitarray2int([1, 1, 1, 1, 1, 1, 1, 1]) returns 255
                 

    
    """
    
    bitstring = "".join([str(i) for i in bitarray])
    
    return int(bitstring,2)