Complete the code to initialize the working memory as an empty dictionary.
working_memory = [1]Working memory is best represented as a dictionary to store key-value pairs of the current task state.
Complete the code to add a key 'current_step' with value 1 to the working memory.
working_memory[[1]] = 1
The key 'current_step' clearly indicates the current step in the task state.
Fix the error in updating the working memory to increment 'current_step' by 1.
working_memory['current_step'] = working_memory['current_step'] [1] 1
Incrementing means adding 1, so the plus sign '+' is correct.
Fill both blanks to check if the 'task_complete' flag in working memory is True and print a message.
if working_memory.get([1], False) [2] True: print('Task is complete')
We check if the 'task_complete' key is equal to True to confirm completion.
Fill all three blanks to create a function that resets the working memory keys 'current_step' to 0, 'task_complete' to False, and 'error_count' to 0.
def reset_memory(memory): memory[[1]] = 0 memory[[2]] = False memory[[3]] = 0
The function resets the keys 'current_step', 'task_complete', and 'error_count' to their initial values.