On 09/30/2017 11:12 AM, Sri G. wrote:
> I'm learning programming with Python.
>
> I’ve written the code below for finding the most common words in a text
> file that has about 1.1 million words. It's working fine, but I believe
> there is always room for improvement.
>
> When run, the function
On 30/09/17 18:12, Sri G. wrote:
> import sysimport collections
I assume that should be two lines?
But you can also import multiple modules on a single line.
import sys, collections
Although some folks don't like that style.
> def find_most_common_words(textfile, top=10):
> ''' Returns
On 30/09/2017 18:12, Sri G. wrote:
I'm learning programming with Python.
I’ve written the code below for finding the most common words in a text
file that has about 1.1 million words. It's working fine, but I believe
there is always room for improvement.
When run, the function in the script
On 30Sep2017 22:42, Sri G. wrote:
I’ve written the code below for finding the most common words in a text
file that has about 1.1 million words. It's working fine, but I believe
there is always room for improvement.
When run, the function in the script gets a text file
I'm learning programming with Python.
I’ve written the code below for finding the most common words in a text
file that has about 1.1 million words. It's working fine, but I believe
there is always room for improvement.
When run, the function in the script gets a text file from the command-line