subject

Write a program that prompts the user for a filename. Open the file, and read it one line at a time. For each line split the line into a list of words called line_list. For each word in the current line_list, look to see if it is in a list called script_list (a list that is initially empty). If the word is not in script_list, add it to the script_list. Sort the script_list alphabetically. Within the same program define a function called freq_count(). This function accepts a str and a list of words as arguments. It traverses the list of words and searches each word and counts the occurrences of the substring str within each word. Print each word along with the number of substring occurrences found within the associated word. Please note that you are not counting the number of occurrences in the file!Modify your program so that it accepts the filename and the substring str as input from the user. After reading the file to build and sort the script_list, pass the script_list into the freq_count() function.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 20:50
What does operator overloading allow you to do?
Answers: 2
question
Computers and Technology, 22.06.2019 16:30
Technician a says that a dry sump system uses no oil storage sump under the engine. technician b says that a wet sump system uses no oil storage sump under the engine. who is correct?
Answers: 3
question
Computers and Technology, 23.06.2019 12:00
Which of these is a benefit of using objects in a powerpoint presentation? a. collaborators can create the external files while you create and edit the slide show. b. you can easily change the theme and design of the presentation. c. you can have older data in the source file while having up-to-date data in the presentation. d. collaborators can easily share the presentation.
Answers: 2
question
Computers and Technology, 23.06.2019 13:10
What is domain name system (dns)? allows dynamic ip address allocation so users do not have to have a preconfigured ip address to use the network converts ip addresses into domains, or identifying labels that use a variety of recognizable naming conventions the efficient coexistence of telephone, video, and data communication within a single network, offering convenience and flexibility not possible with separate infrastructures the integration of communication channels into a single service
Answers: 2
You know the right answer?
Write a program that prompts the user for a filename. Open the file, and read it one line at a time....
Questions
question
Mathematics, 31.10.2020 07:20
question
English, 31.10.2020 07:20
question
Arts, 31.10.2020 07:20
question
Mathematics, 31.10.2020 07:20
question
Mathematics, 31.10.2020 07:20