Scrabble Help: The file dictionary.txt contains all of the words in the Official Scrabble Player's Dictionary, Second Edition. (Note this list contains some offensive language.) Write the following functions in Python. Each function uses the parameter file_name which will be the name of the file containing the dictionary. Your functions must work with any file_name so this should just be a string representing the name of a file in the same directory (folder) as your function. So to test your functions, download the dictionary.txt file into the same directory as your notebook. • length_n(file_name, n): returns an list of all words of length n. • starts_with(file_name, n, first_letter): returns a list of all words of length n beginning with the letter first_letter • contains_letter(file_name, n, included): returns a list of all words of length n containing the letter included but not beginning with it. vowel_heavy(file_name, n, m): returns a list of all words of lengthn with at least m vowels.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter8: I/o Streams And Data Files
Section8.3: Random File Access
Problem 6E
icon
Related questions
Question

Please create your own short dictionary.txt file to test out the functions

Problem 4:
Scrabble Help: The file dictionary.txt contains all of the words in the Official Scrabble Player's Dictionary, Second Edition.
(Note this list contains some offensive language.) Write the following functions in Python. Each function uses the parameter
file_name which will be the name of the file containing the dictionary. Your functions must work with any file_name so this
should just be a string representing the name of a file in the same directory (folder) as your function. So to test your functions,
download the dictionary.txt file into the same directory as your notebook.
• length_n(file_name, n): returns an list of all words of length n.
starts_with(file_name, n, first_letter): returns a list of all words of length n beginning with the letter first_letter
contains_letter(file_name, n, included): returns a list of all words of length n containing the letter included but not
beginning with it.
vowel_heavy(file_name, n, m): returns a list of all words of lengthn with at least m vowels.
In [ ]:
1
def length_n(file_name,n):
2
# your code here
In [ ]:
def starts_with(file_name, n, first_letter):
# your code here
1
2
In [ ]:
1
def contains_letter(file_name, n, included):
2
# your code here
In [ ]:
def vowel_heavy(file_name, n, m):
#3
your code here
Transcribed Image Text:Problem 4: Scrabble Help: The file dictionary.txt contains all of the words in the Official Scrabble Player's Dictionary, Second Edition. (Note this list contains some offensive language.) Write the following functions in Python. Each function uses the parameter file_name which will be the name of the file containing the dictionary. Your functions must work with any file_name so this should just be a string representing the name of a file in the same directory (folder) as your function. So to test your functions, download the dictionary.txt file into the same directory as your notebook. • length_n(file_name, n): returns an list of all words of length n. starts_with(file_name, n, first_letter): returns a list of all words of length n beginning with the letter first_letter contains_letter(file_name, n, included): returns a list of all words of length n containing the letter included but not beginning with it. vowel_heavy(file_name, n, m): returns a list of all words of lengthn with at least m vowels. In [ ]: 1 def length_n(file_name,n): 2 # your code here In [ ]: def starts_with(file_name, n, first_letter): # your code here 1 2 In [ ]: 1 def contains_letter(file_name, n, included): 2 # your code here In [ ]: def vowel_heavy(file_name, n, m): #3 your code here
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Types of trees
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr