Search⌘ K
AI Features

Challenge: Arithmetic Sequence

Explore how to identify the first outlier in an arithmetic sequence using Python lists. Understand list operations, conditional logic, and indexing to solve problems involving sequences and detect deviations efficiently. This lesson helps you apply core Python skills to analyze and manipulate lists with real problem-solving scenarios.

Task

This task requires you to find the index of the first outlier in a given list. All numbers in a list are in an arithmetic sequence, except one number.

Write a program that uses a list and finds the index of the first outlier and stores it to the variable idx. The list is guaranteed to have at least 55 elements and the first two elements will be in the required arithmetic sequence. The value of the idx should be ...