python Complete the function so that it returns 1 if index i of num is a 1 and 0 if index i of num is a 0. Indexing begi
Posted: Tue Apr 12, 2022 10:24 am
python Complete the function so that it returns 1
if index i of num is a 1 and 0
if index i of num is a 0. Indexing
begins at 0.
def check_bit(num, i):
return 1 # index i is a 1
return 0 # index i is a 0
if index i of num is a 1 and 0
if index i of num is a 0. Indexing
begins at 0.
def check_bit(num, i):
return 1 # index i is a 1
return 0 # index i is a 0