Skip to content

Latest commit

 

History

History
12 lines (11 loc) · 451 Bytes

File metadata and controls

12 lines (11 loc) · 451 Bytes

Exercise 6

Write a program, wordcount.py, that opens a file named on the command line and counts how many times each space-separated word occurs in the file. Your program should then print those counts to the screen.

Extra Credit

  • Remove punctuation.
  • Make ranking case-insensitive.
  • Sort output from the highest frequency words to the lowest frequency words.
  • Sort words having the same frequency alphabetically.