montain = [1, 3, 2, 5, 8, 4, 3] answer = 0 for i in range(1,len(montain)-1): if montain[i] > montain[i - 1] and montain[i] > montain[i + 1]: answer += 1 print(answer)
To embed this project on your website, copy the following code and paste it into your website's HTML: