Portfolio

MostFrequentItem


from collections import Counter

text = "After that I bought Thinking in C++ from Bruce Eckel Vol.1 and Vol.2, even now I don't know if it was a good choice or not., " \
"I don't know why I didn't look for the book from The C++ Programming Language from Bjarne Stroustrup but I'm interested to read it" \
"in the future. The book from Eckel, is readable, has good code for understanding, but my opinion is that it has to fill parts with" \
"even for that year, it's a little... peculiar -but we must take the good things from it."

words = text.split()

counter = Counter(words)
top_three = counter.most_common(3)
print(top_three)