Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created August 30, 2021 06:45
words = []
with open("aman.txt", "r") as f:
for line in f:
words.extend(line.split())
from collections import Counter
counts = Counter(words)
top5 = counts.most_common(5)
print(top5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment