items = ["사과", "배", "사과"]
answer = False

for i in range(len(items)-1):
    if items[i] == items[i+1]:
        answer = True
    else:
        answer = False
print(answer)

Embed on website

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