Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

Exercise 3.1 (word count.py). Write a program that takes in a filename and string as input. Then print how many times that string appears inside

image text in transcribed
Exercise 3.1 (word count.py). Write a program that takes in a filename and string as input. Then print how many times that string appears inside the chosen file. If the file does not exist, continue asking for a filename until one is given that exists. Use your source code file as test input. Make sure to test files with that contain the same word multiple times. ? $ python3 word-count.py 2 Please enter a filename: wordcount.py 3 Please enter a string to search for: print The string print' appears 102 times in the file word count.py

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

MySQL/PHP Database Applications

Authors: Jay Greenspan, Brad Bulger

1st Edition

978-0764535376

More Books

Students explore these related Databases questions

Question

Format memos and e-mail properly.

Answered: 3 weeks ago