numbers = [2, 9, 4, 1] max_diff = 0 for i in range(len(numbers) - 1): diff = abs(numbers[i] - numbers[i+1]) if diff > max_diff: max_diff = diff print(max_diff)
To embed this project on your website, copy the following code and paste it into your website's HTML: