+ 2
How to find the 10 most commonly repeated words in a text using Python?
3 ответов
+ 13
What have you got so far? Post a link to your code and we can make suggestions.
I'm thinking you might use:
input().split() to convert text into a list of words, splitting on spaces (you will probably want to remove capitals, commas and periods, etc.)
set() to remove multiples
count() to count occurrences of each word of the set in the list
sorted() to put the words in order of frequency
slicing to list the top ten
+ 7
Here are a few lines of code to demonstrate some of the principles
https://code.sololearn.com/cbjn7Fjf3W85/?ref=app
0
David's answer probably explained all the step required to make it work .He indirectly answered your question, all you need to do is research all the stuff that you don't understand such as set() or split().