scores = [50, 55, 60, 95, 100, 98, 70]

for i in range(len(scores)-5):
    avg1 = (scores[i] + scores[i+1] + scores[i+2]) / 3
    avg2 = (scores[i+1] + scores[i+2] + scores[i+3]) / 3
    
    if avg2 - avg1 >= 30:
        print(i+2)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: