PFP191Xuất hiện trong 2 đề thi
The following code sequence fails with a traceback when the user enters a file that does not exist. How would you avoid the traceback and make it so you could print out your own error message when a bad file name was entered? ```python fname = raw_input('Enter the file name: ') fhand = open(fname) ```
Các lựa chọn
Atry / except
Bsignal handlers
Ctry / catch / finally
Don error resume next