logo CodeStepByStep logo

words_between

Language/Type: Python file input

Write a function named words_between that accepts a file name as a parameter. Your function should read a sorted dictionary from that file, then prompt the user for two words and tell the user how many words in the dictionary fall between those two words. Here is a sample run of the program:

Type two words: goodbye hello
There are 4418 words between goodbye and hello
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.