1 2 3 4 5 6 7 8 9
def set_Bit_Number(n): if (n == 0): return 0; msb = 0; n = int(n / 2); while (n > 0): n = int(n / 2); msb += 1; return (1 << msb)