summaryrefslogtreecommitdiff
path: root/progs/a283.py
blob: dc0e112be64a13050d0e8ae0d9066e518886d4fa (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 (num == new_num): 
        return True
    return False