Conversation
runnersaw
left a comment
There was a problem hiding this comment.
This review is intended to help you with writing readable and understandable code, not to evaluate or improve the functionality of your code.
I have only three small comments to make:
- You can move the declaration of the
RembrandtandMichealangelovariables to right before you callcountingon them, such as:
Michaelangelo=URL("http://www.gutenberg.org/cache/epub/11242/pg11242.txt").download()
counting(Michaelangelo)
This improves the readability of your code by grouping related and sequential tasks.
2. dic [morepureword] should be dic[morepureword]. It's best practice to not put a space when getting a value from a dictionary
3. Printing hundreds of things generally makes it hard for a reader to see what is going on. Decide how many results a user would care about, and only print that many words.
4. Improve the naming of your function and arguments. print_words_by_frequency would be a better name than counting because a reader can immediately tell what is going to happen when it is called. Naming the argument better would also be helpful. In addition, providing a comment at the beginning of each function is recommended, like the following:
def double(x):
'''
This function returns x * 2
'''
Overall, the code was very concise and pretty readable.
No description provided.