summaryrefslogtreecommitdiff
path: root/progs/a591.py
blob: 3ddb9b25b700e8ed6b5a55d6b5e86ce59d0aa367 (plain)
1
2
3
4
5
6
def all_Bits_Set_In_The_Given_Range(n,l,r):  
    num = (((1 << r) - 1) ^ ((1 << (l - 1)) - 1)) 
    new_num = n & num
    if (new_num == 0): 
        return True
    return False