Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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.txt

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

Step: 3

blur-text-image

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

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions