A[i] = A[i - 2] + 2 * B[i - 1]
B[i] = A[i - 1] + B[i - 2]

return A[n]

Feedback: The code above is correct.

### Task End ###

### Task Start ###
# These are the assertions for your function:
assert differ_At_One_Bit_Pos(15,8) == False

""" Write a python function to check whether the two numbers differ at one
bit position only or not. """
def differ_At_One_Bit_Pos(lhs,rhs):

if (lhs - rhs) == 0 or (lhs - rhs) == 1:

return True

return False

Feedback: The code above is wrong. Please fix it.

def differ_At_One_Bit_Pos(a,b):

x = a ^ b
return x and (not(x & (x - 1)))

59

Feedback: The code above is correct.

### Task End ###

### Task Start ###
# These are the assertions for your function:
assert find_char_long(’Please move back to stream’) == [’Please’, ’move’, ’
back’, ’stream’]

""" Write a function to find all words which are at least 4 characters long
in a string by using regex. """
def find_char_long(text):

return (re.findall(r"\b\w{4,}\b", text))
Teaching Large Language Models to Self-Debug