Python 3 Program
Program 4 should first tell users that this is a word analysis software. For any user-given text file, the program will read, analyze, and write each word with the line numbers where the word is found in an output file. A word may appear in multiple lines. A word shows more than once at a line, the line number will be only recorded one time.
Ask a user to enter the name of a text file. Using try/except for invalid user input. Then the program reads the contents of the text file and create a dictionary in which the key-value pairs are described as follows:
Key. The key are the individual words found in the file.
Value. Each value is a list that contains the line numbers in the file where the word (the key) is found. Be aware that a list may have only one element.
Once the dictionary has been built, the program should create another text file for otuput, named “words_index.txt”. Next, write the contents of the dictionary to the file as an alphabetical listing of the words that are stored as keys in the dictionary (sorting the keys), along with the line numbers where the words appear in the original file. Please see the sample file for your reference.
Looking to seeing everyone to submit a well-done program! Here are some tips:
Documents/Comments of your program (Never more)
Testing your program by the given two files, Kennedy.txt . The output file of the Kennedy_index.txt, Kennedy_index_B.txt, Kennedy_index_C.txt, for input file “kennedy.txt”
Remember the output file name of your program is words_index.txt.
For this program, not running one (syntax error) will receive NO point.
Example of original text- Kennedy.txt
We observe today not a victory of party but a celebration of freedom symbolizing an end as well as a beginning signifying renewal as well as change
New text example - Kennedy_index.txt
Text File to be analyzed: Kennedy.txt We: 1 a: 1, 2, 4 an: 3 as: 4, 5, 6 beginning: 4 but: 2 celebration: 2 change: 6 end: 3 freedom: 3 not: 1 observe: 1 of: 2, 3 party: 2 renewal: 5 signifying: 5 symbolizing: 3 today: 1 victory: 1 well: 4, 5
example- Kenndy_index_B.txt
Text File to be analyzed: kennedy.txt
We : 1
a : 1, 2, 4
an : 3
as : 4, 5, 6
beginning : 4
but : 2
celebration : 2
change : 6
end : 3
freedom : 3
not : 1
observe : 1
of : 2, 3
party : 2
renewal : 5
signifying : 5
symbolizing : 3
today : 1
victory : 1
well : 4, 5
example- Kenndy_index_C.txt
Text File to be analyzed: kennedy.txt We : 1 a : 1, 2, 4 an : 3 as : 4, 5, 6 beginning : 4 but : 2 celebration : 2 change : 6 end : 3 freedom : 3 not : 1 observe : 1 of : 2, 3 party : 2 renewal : 5 signifying : 5 symbolizing : 3 today : 1 victory : 1 well : 4, 5
In: Computer Science
A minimum 300-word response to the statement that technological change results in greater unemployment. Also, note what is the most serious type of unemployment resulting from such change and what might be done to mitigate this kind of unemployment.
In: Economics
When dealing with any "prepaid," the company "owes" service and liabilities only have the word "payable" in the account. What are our thought s on this? Please answer in your own words. Do not use outside resources.
In: Accounting
In 300 words or more, define Industry Analysis and outline the role the global & domestic economies, exchange rates; business cycles; industry analysis; the industry structure and performance; and the competitive strategies.
Please stick to the word limit
In: Finance
Write a 175- to 265-word response to the following:
In: Nursing
In: Nursing
In: Nursing
In: Biology
Define each word:
1. Tax-exempt bond.
2. General obligation bond.
3. Revenue bond.
4. Industrial development bond.
5. Tax anticipation note.
6. Equivalent taxable yield.
In: Finance
Discuss the extent to which you agree with the view that taxation is the optimal method that will ensure fewer resources are allocated to the production and consumption of goods that create negative externalities.
Word Limit: 700 words
IN TERMS OF MICRO- ECONOMICS
In: Economics