Question: Problem 7 : ( 1 0 points ) Handling bad file names ( 1 0 points ) Now extend the previous version of your cat

Problem 7: (10 points) Handling bad file names (10 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
I'm a lumberjack and I'm OK
I sleep all night, I work all day
For credit on this problem, extend your solution to problem 6 to add this functionality and re-submit 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!