Question: Use the attached file. Add IF / Then / ELSE and TRY / Except commands to make the code more user friendly so it doesn't
Use the attached file. Add IFThenELSE and TRYExcept commands to make the code more user friendly so it doesn't crash. Submit your code and screen captures of the code executing. Include a list of errors you are checking for in the comments at the top of the program. Do not use Break commands.
# set filename
filename inputWhat file?"
printWORD COUNTER."
looker inputWhat word are you looking for?"
#open file
with openfilename as fileobject:
#red file into a singel variabel called contents
contents fileobject.read
contents contents.replace
count
while count
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
