Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help with this coding!!! This is Python 1. Write a function scan_for(file_name, word) that takes 2 string parameters: 1. file_name - a string
I need help with this coding!!! This is Python
1. Write a function scan_for(file_name, word) that takes 2 string parameters: 1. file_name - a string representing a file name 2. word - a word to scan for in the file 2. The function reads the file and prints the number of occurrences of the specified word that exist in the file, in the format displayed below in the example output. 3. In this program removing punctuation and ignoring case is not required. 4. The following is sample output using a file available with the homework template: >>> scan_for('shoes.txt', 'I') The word I appears 3 times in shoes.txt >>> scan_for('shoes.txt', 'shoes') The word shoes appears 2 times in shoes.txt >>> scan_for('shoes.txt', 'tree') The word tree appears 0 times in shoes.txtStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started