Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i need help with python Input file jabber.txt Right click to save this file to a work folder. You will create the script for this

i need help with python

Input file

jabber.txt

Right click to save this file to a work folder. You will create the script for this lab in the same folder.

Please note: This file uses line-feed characters as line terminators. It will not "look right" if you use old Windows tools, like Notepad to view the contents. In fact, it will look like it's all just run together into a single undifferentiated mass of characters. Try opening the file in IDLE or in the browser. You should see the multiple lines.

For the plus level, the user will use sys.argv to specify the values to search for. So, if the user supplies 'ca', create the output file with the words which contain 'ca' in them, in any case. Here is the expected output:

CA words: catch! Came came! Callooh! Callay!

Here are some other examples:

CK words: Jabberwock, Jabberwock, snicker-snack! back. Jabberwock? HI words: his awhile whiffling galumphing his TC words: catch! Bandersnatch!" OUGH words: sought thought. thought through through through

These will be specified on the command line. The following command-line would create the previous example output file:

python scriptname ck hi tc ough

If there are no command-line arguments after the script name, the contents of jabber-selected-words.txt will be the same as for the check level, the 26 letters of the English language alphabet.

If you have questions about sys.argv, please ask in the forum. We'll talk about it explicitly next week.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions