Question: 
Write a python function to check whether all the bits are within a given range or not.


Model's Code:
def all_Bits_Set_In_The_Given_Range(num, start, end):
    mask = (1 << (end - start + 1)) - 1
    masked_num = (num >> start) & mask
    return masked_num == mask



Sample Correct Code:
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


Asserts:
assert all_Bits_Set_In_The_Given_Range(10,2,1) == True 
assert all_Bits_Set_In_The_Given_Range(5,2,4) == False
assert all_Bits_Set_In_The_Given_Range(22,2,3) == True 


Tests:
Test 1 of 3: PASS
Test 2 of 3: PASS
Test 3 of 3: FAIL: AssertionError()

Test 884 of 974: 679/884 (76.80995475113123%): failed