article = ["apple", "banana", "apple", "cherry", "banana", "apple"]
freq = {}
for i in article:
if i in freq:
freq[i] += 1
else:
freq[i] = 1
sorted_words = sorted(freq.items(), key=lambda x: x[1], reverse=True)
for i, count in sorted_words[:2]:
print(f"{i}: {count}")
To embed this project on your website, copy the following code and paste it into your website's HTML: