Chapter 7 questions

This seems like a typo to me, In the QuestionAnswering section, inside the fuction preprocess_training_examples(examples) there is a loop that finds the end position of the answer, the following code is in the course page.

# Find the start and end of the context
        idx = 0
        while sequence_ids[idx] != 1:
            idx += 1
        context_start = idx
        while sequence_ids[idx] == 1:
            idx += 1
        context_end = idx - 1

This gives an index out-of-range error. I think the correct version is

while sequence_ids[idx] != 1:
            idx += 1
        context_end = idx - 1