Question: Problem 7 : ( 1 0 points ) Handling bad file names ( 1 0 points ) Now extend the previous version of your cat
Problem : points Handling bad file names points
Now extend the previous version of your cat program from the previous problem. It will now add try and except in a loop to keep asking for the file name until it can be opened.
This is how your updated program should work:
Enter a file name to open:spam.txt
Could not open 'spam.txt
Enter a file name to open:what was the name of that file?
Could not open 'what was the name of that file?
Enter a file name to open:song.txt
Im a lumberjack and Im OK
I sleep all night, I work all day
For credit on this problem, extend your solution to problem to add this functionality and resubmit the program to Gradescope with the same name: trycat.py
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
