Question: Your Tasks Modify the sentence - generator program of Case Study 5 - 1 ( in the file generator.py ) so that it inputs its
Your Tasks Modify the sentencegenerator program of Case Study in the file generator.py so that it inputs its vocabulary from a set of text files at startup. The filenames are nouns.txt verbs.txt articles.txt and prepositions.txtHint: Define a single new function, getWords. This function should expect a filename as an argument. The function should open an input file with this name, define a temporary list, read words from the file, and add them to the list. The function should then convert the list to a tuple and return this tuple. Call the function with an actual filename to initialize each of the four variables for the vocabulary.LO: Instructions Task : Define a single new function, getWords. to initialize each of the four variables for the vocabulary.LO: Instructions times Task : Define a single new function, getwords. Test Feedback: Check: Test: Calling getWords with articles.txt return correct tuple. Reason: Expected A 'THE' Error : AssertionError Assertion failed: Expected A 'THE' Timestamp: :: Status: FAILED! Check: Test: Calling getWords with nouns.txt return correct tuple. Reason: Expected BOY 'GIRL', 'BAT', 'BALL' Error : AssertionError Assertion failed: Expected BOY 'GIRL', 'BAT', 'BALL' Timestamp: :: Status: FAILED! Check: Test: Calling getWords with verbs.txt return correct tuple. Reason: Expected HIT 'SAW', 'LIKED' Error : AssertionError Assertion failed: Expected HIT 'SAW', 'LIKED' Timestamp: :: Status: FAILED! Check: Test: Calling getWords with nouns.txt return correct tuple. Reason: Expected WITHBY Error : AssertionError Assertion failed: Expected WITHBY Timestamp: ::
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
