def index_of_first_zero_bit_moving_right_to_left(ii):
    """
    Return the first the index of the first zero bit of the integer ii
    when moving right to left. Returns index in [0,...,nbits(ii)-1]

    # x >> y Returns x with the bits shifted to the right by y places.
    # This is the same as //'ing x by 2**y.

    # x & y Return bitwise and
    """

    jj = 1
    while ((ii & 1) > 0):
        ii >>= 1
        jj += 1
        #print(ii, "{0:b}".format(ii), jj, (ii&1)>0)
    return jj-1