logo CodeStepByStep logo

word_count

Language/Type: Python set collections streams

Write a function named word_count that accepts a file name as a parameter and opens that file and that returns a count of the number of unique words in the file. Do not worry about capitalization and punctuation for example, "Hello" and "hello" and "hello!!" are different words for this problem. Use a set as auxiliary storage.

Function: Write a Python function as described, not a complete program.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.